
<template>
    <div style=" position: relative;"><el-card>
            <template #header>
                <!-- 搜索 -->
                <div>
                    <el-select style="width:160px" v-model="find_data.routeSimpleName" placeholder="请选择行程简称" clearable>
                        <el-option v-for="item in routeSimpleName_list" :key="item.value" :label="item.label"
                            :value="item.value" />
                    </el-select>
                    <el-input style="width: 160px;margin-left: 20px;" v-model="find_data.useCarCompanyId"
                        placeholder="请输入用车单位" clearable prefix-icon="Search" />
                    <el-input type="number" style="width: 140px;margin-left: 20px;" v-model="find_data.personNum"
                        placeholder="请输入人数" clearable prefix-icon="Search" />

                    <el-date-picker value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
                        style="width: 180px;margin-left: 20px;" v-model="find_data.startTime" type="datetime"
                        placeholder="请选择用车时间" />

                    <el-input style="width: 160px;margin-left: 20px;" v-model="find_data.find" placeholder="请输入关键字"
                        clearable prefix-icon="Search" />
                    <el-input style="width: 170px;margin-left: 20px;" v-model="find_data.shareMobile"
                        placeholder="请输入推广人关键字" clearable prefix-icon="Search" />

                    <el-select style="width:160px;margin-left: 20px;" v-model="find_data.isMerge" placeholder="请选择合并标识"
                        clearable>
                        <el-option v-for="item in isMerge_list" :key="item.value" :label="item.label" :value="item.value" />
                    </el-select>

                    <el-button style="margin-left: 20px;height:30px" @click="search_btn" type="primary"
                        icon="Search">搜索</el-button>
                </div>
                <!-- 功能按钮 -->
                <div style="margin-top:10px;display:flex;">
                    <el-button @click="add_btn" type="primary" icon="SuccessFilled">添加</el-button>
                    <!-- <el-button @click="up_btn" type="warning" icon="WarnTriangleFilled">修改</el-button> -->
                    <el-button @click="del_btn" type="danger" icon="CircleCloseFilled">删除</el-button>
                    <!-- <el-button @click="mer_btn" type="success" icon="Finished">合并订单</el-button> -->
                    <!-- <el-button @click="nomer_btn" type="warning" icon="Finished">取消合并</el-button> -->
                    <el-button @click="out_btn" type="warning" icon="Share">导出</el-button>

                    <div style="margin-left:15px"> <el-upload :data="{ checkInFile: '单位客户入住信息' }"
                            :headers="{ 'token': GET_TOKEN(), 'Content-Type': 'multipart/form-data' }" class="upload-excel"
                            :action="importCusCheckInData" :show-file-list="false" :on-success="handleAvatarSuccess"
                            :before-upload="beforeAvatarUpload">
                            <el-button type="warning" icon="Share">导入</el-button>
                        </el-upload></div>
                </div>
            </template>
            <div>
                <el-table border @selection-change="selection_change_btn" height="67vh" ref="multipleTableRef"
                    :data="list_data" style="width: 100%">
                    <el-table-column type="selection" width="35" />
                    <el-table-column label="编号" width="55" fixed type="index" />

                    <template v-for="item in table_data_list_new" :key="item.field">
                        <el-table-column v-if="item.off" :width="item.width" :prop="item.field" :label="item.label">
                            <template v-if="item.field == 'status'" #="{ row, column, $index }">
                                {{ row.status == 'READY_CAR' ? '未派车' : row.status == 'CAR_READY_CONFIRME' ? '待确认' :
                                    row.status
                                        ==
                                        'DRIVER_READY_RECEIVE' ? '待接单' : row.status == 'READY_ROAD' ? '未出行' : row.status ==
                                            'ON_ROADING'
                                            ? '未完团' : row.status == 'FINISHED' ? '完成' : '' }}

                            </template>

                            <template v-if="item.field == 'startDate'" #="{ row, column, $index }">
                                <span>{{ row.startTime.split(' ')[0] }}</span>
                            </template>

                            <template v-if="item.field == 'startTime'" #="{ row, column, $index }">
                                <span>{{ row.startTime.split(' ')[1] }}</span>
                            </template>

                            <template v-if="item.field == 'cusName'" #="{ row, column, $index }">
                                <span>{{ row.cusName }}-{{ row.cusMobile }}</span>
                            </template>

                            <template v-if="item.field == 'shareName'" #="{ row, column, $index }">
                                <span>{{ row.shareName }}-{{ row.shareMobile }}</span>
                            </template>

                            <template v-if="item.field == 'isMerge'" #="{ row, column, $index }">
                                <span>{{ row.isMerge == true ? '合并' : '未合并' }}</span>
                            </template>
                        </el-table-column>
                    </template>
                </el-table>
            </div>

            <div style="margin-top:20px">
                <el-pagination @current-change="current_change_btn" @size-change="size_change_btn"
                    v-model:current-page="find_data.page.pageNum" v-model:page-size="find_data.page.pageSize"
                    :page-sizes="[20, 50, 100, 200]" :background="true" layout="prev, pager, next, jumper,->,sizes,total,"
                    :total="total" />
            </div>
        </el-card>
    </div>

    <!-- 弹窗 -->
    <div>
        <!-- 表格筛选 -->
        <div style="position: absolute;top:100px;z-index: 9999;" :style="icon_off ? 'right:0px;' : 'right:110px;'">
            <el-icon @click="icon_btn" :size="20">
                <Setting />
            </el-icon>
            <div v-show="icon_off"
                style=" position: relative;top:-100px;right:140px;width: 130px;height:430px;background:#fff;overflow: hidden;">
                <div class="cols-set" style="background:#fff;width:90%;height:97%;margin:auto;margin-top:10px;">
                    <div>
                        <el-button-group style="display: flex; ">
                            <el-tooltip effect="dark" placement="bottom">
                                <template #content>注意：拖动下面的项，可以改变表格列的顺序，<br />记得点击保存才会永久生效哦！ </template>
                                <el-button style="width:10px" type="primary" icon="WarningFilled"></el-button>
                            </el-tooltip>
                            <el-button title="重置" type="primary" icon="Refresh" @click="resetTableSet"></el-button>
                            <el-button title="保存" type="primary" icon="Check" @click="saveTableSet"></el-button>
                        </el-button-group>
                        <div ref="sortableContainer" class="col-items" style="height:400px; overflow-y: auto; ">
                            <el-checkbox class="drag_it" @change="checkbox_btn" v-for="item in sortedItems"
                                :key="item.field" v-model="item.off" :label="item.label" border>
                            </el-checkbox>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        <!-- 添加修改 -->
        <el-dialog style="margin-top:5vh" v-model="add_off" :title="title"
            :width="add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是' ? '80%' : '40%'"
            :close-on-click-modal='false'>
            <div style="display:flex;">
                <div :style="add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是' ? 'width:48%' : ''">
                    <div style="color:red;margin-bottom:20px;">系统默认拼车时间30分钟：系统自动按照当前出发时间前后30分钟可拼订单自动拼单！
                    </div>

                    <el-tabs type="card" v-model="activeName_tabs1" class="demo-tabs" @tab-click="handleClick_tabs1">

                        <div style="display:flex">
                            <el-tab-pane label="飞机" name="aircraft">
                                <el-tabs style="margin-left:10px" v-model="activeName_tabs2" class="demo-tabs"
                                    @tab-click="handleClick_tabs2">
                                    <el-tab-pane :label="'接' + aircraft_name" name="aircraft_connect">
                                        <el-form :model="add_data" label-width="110px" label-suffix="：">


                                            <div style="display:flex;">
                                                <el-button @click="land_se_btn" style="margin-left:20px"
                                                    type="primary">航班号自动查询</el-button>
                                                <el-form-item label="接机时间" :required="false">
                                                    <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                        format="YYYY-MM-DD HH:mm" v-model="add_data.landDate"
                                                        type="datetime" placeholder="请选择接机时间" />
                                                </el-form-item>


                                            </div>

                                            <div style="display:flex;width:35vw;">

                                                <el-form-item label="接机地点" :required="false">
                                                    <el-select @change="aircraft_connect_change" style="width:150px"
                                                        v-model="add_data.fromLocation" placeholder="请选择接机地点" clearable>
                                                        <el-option v-for="item in aircraft_list" :key="item.id"
                                                            :label="item.station_name" :value="item.station_name" />
                                                    </el-select>
                                                    <el-radio-group v-if="chartered_bus_off" v-model="aircraft_radio"
                                                        style="margin-left:20px;">
                                                        <el-radio label="拼车" size="large">拼车</el-radio>
                                                        <el-radio label="包车" size="large">包车</el-radio>
                                                    </el-radio-group>
                                                    <el-button style="margin-left:30px;margin-bottom:0px"
                                                        @click="add_passing_points(1)" type="warning">添加途经点</el-button>
                                                </el-form-item>

                                            </div>
                                            <template v-if="passing_points_list.length > 0">
                                                <el-form-item v-for="(item, index) in passing_points_index" :key="index"
                                                    label="途经地点：">
                                                    <!-- @click="choseMapPoint" -->
                                                    <div style="display: flex;">
                                                        <div
                                                            style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                            {{
                                                                passing_points_list[index].area + '-' +
                                                                passing_points_list[index].name
                                                            }}</div>

                                                        <div style="margin-left: 40px;">
                                                            <el-button @click="passing_points_index_delbtn(index)"
                                                                type="danger" icon="Close" plain size="mini" title="删除途经">
                                                                删除途经
                                                            </el-button>
                                                        </div>
                                                    </div>
                                                </el-form-item>
                                            </template>
                                            <div style="display:flex;">
                                                <el-form-item label="目的地址" :required="false">
                                                    <el-select @change="select_Btn" v-model="add_data.toLocation"
                                                        class="m-2" placeholder="请选择目的地址" size="large">
                                                        <el-option v-for="item in getStationList_Data"
                                                            :key="item.stationName" :label="item.stationName"
                                                            :value="item.stationName" />
                                                    </el-select>
                                                </el-form-item>
                                                <el-button @click="map_off_btn" style="margin-left:30px;margin-bottom:10px"
                                                    type="primary">地图选址</el-button>
                                            </div>
                                            <el-form-item type="number" label="预约人数" :required="false">
                                                <el-input style="width:220px" v-model="add_data.personNum"
                                                    placeholder="请输入预约人数" />
                                            </el-form-item>
                                            <el-form-item v-if="aircraft_radio != '拼车'" label="指定车型" :required="false">
                                                <el-select v-model="add_data.needSeats" :filterable="false"
                                                    placeholder="请选择指定车型" style="width: 220px;">
                                                    <el-option label="5座" value="5"></el-option>
                                                    <el-option label="7座" value="7"></el-option>
                                                    <el-option label="9座" value="9"></el-option>
                                                    <el-option label="12座" value="12"></el-option>
                                                    <el-option label="14座" value="14"></el-option>
                                                    <el-option label="17座" value="17"></el-option>
                                                    <el-option label="30座" value="30"></el-option>
                                                    <el-option label="39座" value="39"></el-option>
                                                    <el-option label="49座" value="49"></el-option>
                                                    <el-option label="55座" value="55"></el-option>

                                                </el-select>
                                            </el-form-item>
                                            <el-form-item v-if="aircraft_radio != '拼车'" label="包车天数" :required="false">
                                                <el-input style="width:220px" v-model="add_data.days"
                                                    placeholder="请输入包车天数" />
                                            </el-form-item>
                                            <div style="display:flex;" v-if="aircraft_radio != '拼车'">
                                                <el-form-item label="包车价格" :required="false">
                                                    <el-input style="width:220px" v-model="add_data.price"
                                                        placeholder="请输入包车价格" />
                                                </el-form-item>

                                                <!-- <el-button icon="PieChart" @click="price_btn(1)"
                                                    style="margin-left:30px;margin-bottom:10px"
                                                    type="primary">自动计算价格</el-button> -->
                                            </div>

                                            <el-form-item v-if="aircraft_radio != '拼车'" label="是否走高速" :required="false">
                                                <el-select v-model="add_data.isHighSpeed" :filterable="false"
                                                    placeholder="请选择是否走高速" style="width: 220px;">
                                                    <el-option label="走高速" value="1"></el-option>
                                                    <el-option label="不走高速" value="0"></el-option>

                                                </el-select>
                                            </el-form-item>

                                            <el-form-item label="联系人姓名" :required="false">
                                                <el-input style="width:220px" v-model="add_data.cusName"
                                                    placeholder="请输入联系人姓名" />
                                            </el-form-item>
                                            <div style="display:flex;">
                                                <el-form-item type="number" label="联系人电话" :required="false">
                                                    <el-input style="width:220px" v-model="add_data.cusMobile"
                                                        placeholder="请输入联系人电话" />
                                                </el-form-item>
                                                <el-button v-if="aircraft_radio != '拼车'" @click="add_cusName_btn(1)"
                                                    style="margin-left:30px;margin-bottom:10px"
                                                    type="warning">添加联系人</el-button>
                                            </div>
                                            <template v-if="add_cusName_list.length > 0">
                                                <el-form-item v-for="(item, index) in add_cusName_index" :key="index"
                                                    label="联系人：">
                                                    <!-- @click="choseMapPoint" -->
                                                    <div style="display: flex;">
                                                        <div style="display: flex;">
                                                            <el-input style="width:220px"
                                                                v-model="add_cusName_list[index].name"
                                                                placeholder="请输入联系人姓名" />
                                                            <el-input style="width:220px"
                                                                v-model="add_cusName_list[index].mobile"
                                                                placeholder="请输入联系人电话" />
                                                        </div>

                                                        <div style="margin-left: 40px;">
                                                            <el-button @click="add_cusName_index_delbtn(index)"
                                                                type="danger" icon="Close" plain size="mini" title="联系人">
                                                                联系人
                                                            </el-button>
                                                        </div>
                                                    </div>
                                                </el-form-item>
                                            </template>
                                            <el-form-item label="是否返程" :required="false">
                                                <el-select @change="isReturnAdd_change" style="width:220px"
                                                    v-model="add_data.isReturnAdd" placeholder="请选择是否返程">
                                                    <el-option v-for="item in isReturn_list" :key="item.value"
                                                        :label="item.label" :value="item.value" />
                                                </el-select>
                                            </el-form-item>
                                            <el-collapse>
                                                <el-collapse-item title="显示更多选填信息" name="1">

                                                    <el-form-item label="备注" :required="false">
                                                        <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                            placeholder="请输入备注" v-model="add_data.remark" />
                                                    </el-form-item>
                                                </el-collapse-item>

                                            </el-collapse>







                                        </el-form>
                                    </el-tab-pane>
                                    <el-tab-pane :label="'送' + aircraft_name" name="aircraft_deliver">
                                        <el-form :model="add_data" label-width="110px" label-suffix="：">


                                            <div style="display:flex;">
                                                <el-button @click="land_se_btn" style="margin-left:20px"
                                                    type="primary">航班号自动查询</el-button>
                                                <el-form-item label="送机时间" :required="false">
                                                    <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                        format="YYYY-MM-DD HH:mm" v-model="add_data.landDate"
                                                        type="datetime" placeholder="请选择送机时间" />
                                                </el-form-item>


                                            </div>
                                            <div style="display:flex;">
                                                <el-form-item label="接人地址" :required="false">
                                                    <el-select @change="select_Btn" v-model="add_data.fromLocation"
                                                        class="m-2" placeholder="请选择接人地址" size="large">
                                                        <el-option v-for="item in getStationList_Data"
                                                            :key="item.stationName" :label="item.stationName"
                                                            :value="item.stationName" />
                                                    </el-select>
                                                </el-form-item>
                                                <el-button @click="map_off_btn" style="margin-left:30px;margin-bottom:10px"
                                                    type="primary">地图选址</el-button>
                                            </div>

                                            <template v-if="passing_points_list.length > 0">
                                                <el-form-item v-for="(item, index) in passing_points_index" :key="index"
                                                    label="途经地点：">
                                                    <!-- @click="choseMapPoint" -->
                                                    <div style="display: flex;">
                                                        <div
                                                            style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                            {{
                                                                passing_points_list[index].area + '-' +
                                                                passing_points_list[index].name
                                                            }}</div>

                                                        <div style="margin-left: 40px;">
                                                            <el-button @click="passing_points_index_delbtn(index)"
                                                                type="danger" icon="Close" plain size="mini" title="删除途经">
                                                                删除途经
                                                            </el-button>
                                                        </div>
                                                    </div>
                                                </el-form-item>
                                            </template>
                                            <div style="display:flex;width:35vw;">

                                                <el-form-item label="送机地点" :required="false">
                                                    <el-select @change="aircraft_connect_change" style="width:150px"
                                                        v-model="add_data.toLocation" placeholder="请选择送机地点" clearable>
                                                        <el-option v-for="item in aircraft_list" :key="item.id"
                                                            :label="item.station_name" :value="item.station_name" />
                                                    </el-select>
                                                    <el-radio-group v-if="chartered_bus_off" v-model="aircraft_radio"
                                                        style="margin-left:20px;">
                                                        <el-radio label="拼车" size="large">拼车</el-radio>
                                                        <el-radio label="包车" size="large">包车</el-radio>
                                                    </el-radio-group>
                                                    <el-button style="margin-left:30px;margin-bottom:0px"
                                                        @click="add_passing_points(1)" type="warning">添加途经点</el-button>
                                                </el-form-item>

                                            </div>

                                            <el-form-item type="number" label="预约人数" :required="false">
                                                <el-input style="width:220px" v-model="add_data.personNum"
                                                    placeholder="请输入预约人数" />
                                            </el-form-item>
                                            <el-form-item v-if="aircraft_radio != '拼车'" label="指定车型" :required="false">
                                                <el-select v-model="add_data.needSeats" :filterable="false"
                                                    placeholder="请选择指定车型" style="width: 220px;">
                                                    <el-option label="5座" value="5"></el-option>
                                                    <el-option label="7座" value="7"></el-option>
                                                    <el-option label="9座" value="9"></el-option>
                                                    <el-option label="12座" value="12"></el-option>
                                                    <el-option label="14座" value="14"></el-option>
                                                    <el-option label="17座" value="17"></el-option>
                                                    <el-option label="30座" value="30"></el-option>
                                                    <el-option label="39座" value="39"></el-option>
                                                    <el-option label="49座" value="49"></el-option>
                                                    <el-option label="55座" value="55"></el-option>

                                                </el-select>
                                            </el-form-item>
                                            <el-form-item v-if="aircraft_radio != '拼车'" label="包车天数" :required="false">
                                                <el-input style="width:220px" v-model="add_data.days"
                                                    placeholder="请输入包车天数" />
                                            </el-form-item>
                                            <div style="display:flex;" v-if="aircraft_radio != '拼车'">
                                                <el-form-item label="包车价格" :required="false">
                                                    <el-input style="width:220px" v-model="add_data.price"
                                                        placeholder="请输入包车价格" />
                                                </el-form-item>

                                                <!-- <el-button icon="PieChart" @click="price_btn(1)"
                                                    style="margin-left:30px;margin-bottom:10px"
                                                    type="primary">自动计算价格</el-button> -->
                                            </div>

                                            <el-form-item v-if="aircraft_radio != '拼车'" label="是否走高速" :required="false">
                                                <el-select v-model="add_data.isHighSpeed" :filterable="false"
                                                    placeholder="请选择是否走高速" style="width: 220px;">
                                                    <el-option label="走高速" value="1"></el-option>
                                                    <el-option label="不走高速" value="0"></el-option>

                                                </el-select>
                                            </el-form-item>

                                            <el-form-item label="联系人姓名" :required="false">
                                                <el-input style="width:220px" v-model="add_data.cusName"
                                                    placeholder="请输入联系人姓名" />
                                            </el-form-item>
                                            <div style="display:flex;">
                                                <el-form-item type="number" label="联系人电话" :required="false">
                                                    <el-input style="width:220px" v-model="add_data.cusMobile"
                                                        placeholder="请输入联系人电话" />
                                                </el-form-item>
                                                <el-button v-if="aircraft_radio != '拼车'" @click="add_cusName_btn(1)"
                                                    style="margin-left:30px;margin-bottom:10px"
                                                    type="warning">添加联系人</el-button>
                                            </div>
                                            <template v-if="add_cusName_list.length > 0">
                                                <el-form-item v-for="(item, index) in add_cusName_index" :key="index"
                                                    label="联系人：">
                                                    <!-- @click="choseMapPoint" -->
                                                    <div style="display: flex;">
                                                        <div style="display: flex;">
                                                            <el-input style="width:220px"
                                                                v-model="add_cusName_list[index].name"
                                                                placeholder="请输入联系人姓名" />
                                                            <el-input style="width:220px"
                                                                v-model="add_cusName_list[index].mobile"
                                                                placeholder="请输入联系人电话" />
                                                        </div>

                                                        <div style="margin-left: 40px;">
                                                            <el-button @click="add_cusName_index_delbtn(index)"
                                                                type="danger" icon="Close" plain size="mini" title="联系人">
                                                                联系人
                                                            </el-button>
                                                        </div>
                                                    </div>
                                                </el-form-item>
                                            </template>
                                            <el-form-item label="是否返程" :required="false">
                                                <el-select @change="isReturnAdd_change" style="width:220px"
                                                    v-model="add_data.isReturnAdd" placeholder="请选择是否返程">
                                                    <el-option v-for="item in isReturn_list" :key="item.value"
                                                        :label="item.label" :value="item.value" />
                                                </el-select>
                                            </el-form-item>
                                            <el-collapse>
                                                <el-collapse-item title="显示更多选填信息" name="1">

                                                    <el-form-item label="备注" :required="false">
                                                        <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                            placeholder="请输入备注" v-model="add_data.remark" />
                                                    </el-form-item>
                                                </el-collapse-item>

                                            </el-collapse>







                                        </el-form>
                                    </el-tab-pane>
                                </el-tabs>
                            </el-tab-pane>


                        </div>



                        <el-tab-pane label="火车" name="train">
                            <el-tabs style="margin-left:10px" v-model="activeName_tabs2" class="demo-tabs"
                                @tab-click="handleClick_tabs2">
                                <el-tab-pane :label="'接' + train_name" name="aircraft_connect">
                                    <el-form :model="add_data" label-width="110px" label-suffix="：">


                                        <div style="display:flex;">
                                            <!-- <el-button @click="land_se_btn" style="margin-left:20px"
                                                type="primary">航班号自动查询</el-button> -->
                                            <el-form-item label="接火车时间" :required="false">
                                                <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                    format="YYYY-MM-DD HH:mm" v-model="add_data.landDate" type="datetime"
                                                    placeholder="请选择接火车时间" />
                                            </el-form-item>


                                        </div>

                                        <div style="display:flex;width:35vw;">

                                            <el-form-item label="接火车地点" :required="false">
                                                <el-select @change="aircraft_connect_change" style="width:150px"
                                                    v-model="add_data.fromLocation" placeholder="请选择接火车地点" clearable>
                                                    <el-option v-for="item in train_list" :key="item.id"
                                                        :label="item.station_name" :value="item.station_name" />
                                                </el-select>
                                                <el-radio-group v-if="chartered_bus_off" v-model="aircraft_radio"
                                                    style="margin-left:20px;">
                                                    <el-radio label="拼车" size="large">拼车</el-radio>
                                                    <el-radio label="包车" size="large">包车</el-radio>
                                                </el-radio-group>
                                                <el-button style="margin-left:30px;margin-bottom:0px"
                                                    @click="add_passing_points(1)" type="warning">添加途经点</el-button>
                                            </el-form-item>

                                        </div>
                                        <template v-if="passing_points_list.length > 0">
                                            <el-form-item v-for="(item, index) in passing_points_index" :key="index"
                                                label="途经地点：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div
                                                        style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                        {{
                                                            passing_points_list[index].area + '-' +
                                                            passing_points_list[index].name
                                                        }}</div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="passing_points_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="删除途经">
                                                            删除途经
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <div style="display:flex;">
                                            <el-form-item label="目的地址" :required="false">
                                                <el-select @change="select_Btn" v-model="add_data.toLocation" class="m-2"
                                                    placeholder="请选择目的地址" size="large">
                                                    <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                        :label="item.stationName" :value="item.stationName" />
                                                </el-select>
                                            </el-form-item>
                                            <el-button @click="map_off_btn" style="margin-left:30px;margin-bottom:10px"
                                                type="primary">地图选址</el-button>
                                        </div>
                                        <el-form-item type="number" label="预约人数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.personNum"
                                                placeholder="请输入预约人数" />
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="指定车型" :required="false">
                                            <el-select v-model="add_data.needSeats" :filterable="false"
                                                placeholder="请选择指定车型" style="width: 220px;">
                                                <el-option label="5座" value="5"></el-option>
                                                <el-option label="7座" value="7"></el-option>
                                                <el-option label="9座" value="9"></el-option>
                                                <el-option label="12座" value="12"></el-option>
                                                <el-option label="14座" value="14"></el-option>
                                                <el-option label="17座" value="17"></el-option>
                                                <el-option label="30座" value="30"></el-option>
                                                <el-option label="39座" value="39"></el-option>
                                                <el-option label="49座" value="49"></el-option>
                                                <el-option label="55座" value="55"></el-option>

                                            </el-select>
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="包车天数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.days" placeholder="请输入包车天数" />
                                        </el-form-item>
                                        <div style="display:flex;" v-if="aircraft_radio != '拼车'">
                                            <el-form-item label="包车价格" :required="false">
                                                <el-input style="width:220px" v-model="add_data.price"
                                                    placeholder="请输入包车价格" />
                                            </el-form-item>

                                            <!-- <el-button icon="PieChart" @click="price_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px"
                                                type="primary">自动计算价格</el-button> -->
                                        </div>

                                        <el-form-item v-if="aircraft_radio != '拼车'" label="是否走高速" :required="false">
                                            <el-select v-model="add_data.isHighSpeed" :filterable="false"
                                                placeholder="请选择是否走高速" style="width: 220px;">
                                                <el-option label="走高速" value="1"></el-option>
                                                <el-option label="不走高速" value="0"></el-option>

                                            </el-select>
                                        </el-form-item>

                                        <el-form-item label="联系人姓名" :required="false">
                                            <el-input style="width:220px" v-model="add_data.cusName"
                                                placeholder="请输入联系人姓名" />
                                        </el-form-item>
                                        <div style="display:flex;">
                                            <el-form-item type="number" label="联系人电话" :required="false">
                                                <el-input style="width:220px" v-model="add_data.cusMobile"
                                                    placeholder="请输入联系人电话" />
                                            </el-form-item>
                                            <el-button v-if="aircraft_radio != '拼车'" @click="add_cusName_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                        </div>
                                        <template v-if="add_cusName_list.length > 0">
                                            <el-form-item v-for="(item, index) in add_cusName_index" :key="index"
                                                label="联系人：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div style="display: flex;">
                                                        <el-input style="width:220px" v-model="add_cusName_list[index].name"
                                                            placeholder="请输入联系人姓名" />
                                                        <el-input style="width:220px"
                                                            v-model="add_cusName_list[index].mobile"
                                                            placeholder="请输入联系人电话" />
                                                    </div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="add_cusName_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="联系人">
                                                            联系人
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <el-form-item label="是否返程" :required="false">
                                            <el-select @change="isReturnAdd_change" style="width:220px"
                                                v-model="add_data.isReturnAdd" placeholder="请选择是否返程">
                                                <el-option v-for="item in isReturn_list" :key="item.value"
                                                    :label="item.label" :value="item.value" />
                                            </el-select>
                                        </el-form-item>
                                        <el-collapse>
                                            <el-collapse-item title="显示更多选填信息" name="1">

                                                <el-form-item label="备注" :required="false">
                                                    <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                        placeholder="请输入备注" v-model="add_data.remark" />
                                                </el-form-item>
                                            </el-collapse-item>

                                        </el-collapse>







                                    </el-form>
                                </el-tab-pane>
                                <el-tab-pane :label="'送' + train_name" name="aircraft_deliver">
                                    <el-form :model="add_data" label-width="110px" label-suffix="：">


                                        <div style="display:flex;">
                                            <!-- <el-button @click="land_se_btn" style="margin-left:20px"
                                                type="primary">航班号自动查询</el-button> -->
                                            <el-form-item label="送火车时间" :required="false">
                                                <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                    format="YYYY-MM-DD HH:mm" v-model="add_data.landDate" type="datetime"
                                                    placeholder="请选择送火车时间" />
                                            </el-form-item>


                                        </div>
                                        <div style="display:flex;">
                                            <el-form-item label="接人地址" :required="false">
                                                <el-select @change="select_Btn" v-model="add_data.fromLocation" class="m-2"
                                                    placeholder="请选择接人地址" size="large">
                                                    <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                        :label="item.stationName" :value="item.stationName" />
                                                </el-select>
                                            </el-form-item>
                                            <el-button @click="map_off_btn" style="margin-left:30px;margin-bottom:10px"
                                                type="primary">地图选址</el-button>
                                        </div>

                                        <template v-if="passing_points_list.length > 0">
                                            <el-form-item v-for="(item, index) in passing_points_index" :key="index"
                                                label="途经地点：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div
                                                        style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                        {{
                                                            passing_points_list[index].area + '-' +
                                                            passing_points_list[index].name
                                                        }}</div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="passing_points_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="删除途经">
                                                            删除途经
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <div style="display:flex;width:35vw;">

                                            <el-form-item label="送火车地点" :required="false">
                                                <el-select @change="aircraft_connect_change" style="width:150px"
                                                    v-model="add_data.toLocation" placeholder="请选择送火车地点" clearable>
                                                    <el-option v-for="item in train_list" :key="item.id"
                                                        :label="item.station_name" :value="item.station_name" />
                                                </el-select>
                                                <el-radio-group v-if="chartered_bus_off" v-model="aircraft_radio"
                                                    style="margin-left:20px;">
                                                    <el-radio label="拼车" size="large">拼车</el-radio>
                                                    <el-radio label="包车" size="large">包车</el-radio>
                                                </el-radio-group>
                                                <el-button style="margin-left:30px;margin-bottom:0px"
                                                    @click="add_passing_points(1)" type="warning">添加途经点</el-button>
                                            </el-form-item>

                                        </div>

                                        <el-form-item type="number" label="预约人数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.personNum"
                                                placeholder="请输入预约人数" />
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="指定车型" :required="false">
                                            <el-select v-model="add_data.needSeats" :filterable="false"
                                                placeholder="请选择指定车型" style="width: 220px;">
                                                <el-option label="5座" value="5"></el-option>
                                                <el-option label="7座" value="7"></el-option>
                                                <el-option label="9座" value="9"></el-option>
                                                <el-option label="12座" value="12"></el-option>
                                                <el-option label="14座" value="14"></el-option>
                                                <el-option label="17座" value="17"></el-option>
                                                <el-option label="30座" value="30"></el-option>
                                                <el-option label="39座" value="39"></el-option>
                                                <el-option label="49座" value="49"></el-option>
                                                <el-option label="55座" value="55"></el-option>

                                            </el-select>
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="包车天数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.days" placeholder="请输入包车天数" />
                                        </el-form-item>
                                        <div style="display:flex;" v-if="aircraft_radio != '拼车'">
                                            <el-form-item label="包车价格" :required="false">
                                                <el-input style="width:220px" v-model="add_data.price"
                                                    placeholder="请输入包车价格" />
                                            </el-form-item>

                                            <!-- <el-button icon="PieChart" @click="price_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px"
                                                type="primary">自动计算价格</el-button> -->
                                        </div>

                                        <el-form-item v-if="aircraft_radio != '拼车'" label="是否走高速" :required="false">
                                            <el-select v-model="add_data.isHighSpeed" :filterable="false"
                                                placeholder="请选择是否走高速" style="width: 220px;">
                                                <el-option label="走高速" value="1"></el-option>
                                                <el-option label="不走高速" value="0"></el-option>

                                            </el-select>
                                        </el-form-item>

                                        <el-form-item label="联系人姓名" :required="false">
                                            <el-input style="width:220px" v-model="add_data.cusName"
                                                placeholder="请输入联系人姓名" />
                                        </el-form-item>
                                        <div style="display:flex;">
                                            <el-form-item type="number" label="联系人电话" :required="false">
                                                <el-input style="width:220px" v-model="add_data.cusMobile"
                                                    placeholder="请输入联系人电话" />
                                            </el-form-item>
                                            <el-button v-if="aircraft_radio != '拼车'" @click="add_cusName_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                        </div>
                                        <template v-if="add_cusName_list.length > 0">
                                            <el-form-item v-for="(item, index) in add_cusName_index" :key="index"
                                                label="联系人：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div style="display: flex;">
                                                        <el-input style="width:220px" v-model="add_cusName_list[index].name"
                                                            placeholder="请输入联系人姓名" />
                                                        <el-input style="width:220px"
                                                            v-model="add_cusName_list[index].mobile"
                                                            placeholder="请输入联系人电话" />
                                                    </div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="add_cusName_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="联系人">
                                                            联系人
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <el-form-item label="是否返程" :required="false">
                                            <el-select @change="isReturnAdd_change" style="width:220px"
                                                v-model="add_data.isReturnAdd" placeholder="请选择是否返程">
                                                <el-option v-for="item in isReturn_list" :key="item.value"
                                                    :label="item.label" :value="item.value" />
                                            </el-select>
                                        </el-form-item>
                                        <el-collapse>
                                            <el-collapse-item title="显示更多选填信息" name="1">

                                                <el-form-item label="备注" :required="false">
                                                    <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                        placeholder="请输入备注" v-model="add_data.remark" />
                                                </el-form-item>
                                            </el-collapse-item>

                                        </el-collapse>







                                    </el-form>
                                </el-tab-pane>
                            </el-tabs>
                        </el-tab-pane>


                        
                        <el-tab-pane label="大巴" name="bus">
                            <el-tabs style="margin-left:10px" v-model="activeName_tabs2" class="demo-tabs"
                                @tab-click="handleClick_tabs2">
                                <el-tab-pane :label="'接' + bus_name" name="aircraft_connect">
                                    <el-form :model="add_data" label-width="110px" label-suffix="：">


                                        <div style="display:flex;">
                                            <!-- <el-button @click="land_se_btn" style="margin-left:20px"
                                                type="primary">航班号自动查询</el-button> -->
                                            <el-form-item label="接车时间" :required="false">
                                                <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                    format="YYYY-MM-DD HH:mm" v-model="add_data.landDate" type="datetime"
                                                    placeholder="请选择接车时间" />
                                            </el-form-item>


                                        </div>

                                        <div style="display:flex;width:35vw;">

                                            <el-form-item label="接车地点" :required="false">
                                                <div @click="car_map_btn(1)">
                                                    <el-input style="width:220px" v-model="add_data.fromLocation"
                                                        placeholder="请选择接车地点" />
                                                </div>
                                                <el-radio-group v-if="chartered_bus_off" v-model="aircraft_radio"
                                                    style="margin-left:20px;">
                                                    <el-radio label="拼车" size="large">拼车</el-radio>
                                                    <el-radio label="包车" size="large">包车</el-radio>
                                                </el-radio-group>
                                                <el-button style="margin-left:30px;margin-bottom:0px"
                                                    @click="add_passing_points(1)" type="warning">添加途经点</el-button>
                                            </el-form-item>

                                        </div>
                                        <template v-if="passing_points_list.length > 0">
                                            <el-form-item v-for="(item, index) in passing_points_index" :key="index"
                                                label="途经地点：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div
                                                        style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                        {{
                                                            passing_points_list[index].area + '-' +
                                                            passing_points_list[index].name
                                                        }}</div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="passing_points_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="删除途经">
                                                            删除途经
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <div style="display:flex;">
                                            <el-form-item label="目的地址" :required="false">
                                                <el-select @change="select_Btn" v-model="add_data.toLocation" class="m-2"
                                                    placeholder="请选择目的地址" size="large">
                                                    <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                        :label="item.stationName" :value="item.stationName" />
                                                </el-select>
                                            </el-form-item>
                                            <el-button @click="map_off_btn" style="margin-left:30px;margin-bottom:10px"
                                                type="primary">地图选址</el-button>
                                        </div>
                                        <el-form-item type="number" label="预约人数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.personNum"
                                                placeholder="请输入预约人数" />
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="指定车型" :required="false">
                                            <el-select v-model="add_data.needSeats" :filterable="false"
                                                placeholder="请选择指定车型" style="width: 220px;">
                                                <el-option label="5座" value="5"></el-option>
                                                <el-option label="7座" value="7"></el-option>
                                                <el-option label="9座" value="9"></el-option>
                                                <el-option label="12座" value="12"></el-option>
                                                <el-option label="14座" value="14"></el-option>
                                                <el-option label="17座" value="17"></el-option>
                                                <el-option label="30座" value="30"></el-option>
                                                <el-option label="39座" value="39"></el-option>
                                                <el-option label="49座" value="49"></el-option>
                                                <el-option label="55座" value="55"></el-option>

                                            </el-select>
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="包车天数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.days" placeholder="请输入包车天数" />
                                        </el-form-item>
                                        <div style="display:flex;" v-if="aircraft_radio != '拼车'">
                                            <el-form-item label="包车价格" :required="false">
                                                <el-input style="width:220px" v-model="add_data.price"
                                                    placeholder="请输入包车价格" />
                                            </el-form-item>

                                            <!-- <el-button icon="PieChart" @click="price_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px"
                                                type="primary">自动计算价格</el-button> -->
                                        </div>

                                        <el-form-item v-if="aircraft_radio != '拼车'" label="是否走高速" :required="false">
                                            <el-select v-model="add_data.isHighSpeed" :filterable="false"
                                                placeholder="请选择是否走高速" style="width: 220px;">
                                                <el-option label="走高速" value="1"></el-option>
                                                <el-option label="不走高速" value="0"></el-option>

                                            </el-select>
                                        </el-form-item>

                                        <el-form-item label="联系人姓名" :required="false">
                                            <el-input style="width:220px" v-model="add_data.cusName"
                                                placeholder="请输入联系人姓名" />
                                        </el-form-item>
                                        <div style="display:flex;">
                                            <el-form-item type="number" label="联系人电话" :required="false">
                                                <el-input style="width:220px" v-model="add_data.cusMobile"
                                                    placeholder="请输入联系人电话" />
                                            </el-form-item>
                                            <el-button v-if="aircraft_radio != '拼车'" @click="add_cusName_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                        </div>
                                        <template v-if="add_cusName_list.length > 0">
                                            <el-form-item v-for="(item, index) in add_cusName_index" :key="index"
                                                label="联系人：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div style="display: flex;">
                                                        <el-input style="width:220px" v-model="add_cusName_list[index].name"
                                                            placeholder="请输入联系人姓名" />
                                                        <el-input style="width:220px"
                                                            v-model="add_cusName_list[index].mobile"
                                                            placeholder="请输入联系人电话" />
                                                    </div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="add_cusName_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="联系人">
                                                            联系人
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <el-form-item label="是否返程" :required="false">
                                            <el-select @change="isReturnAdd_change" style="width:220px"
                                                v-model="add_data.isReturnAdd" placeholder="请选择是否返程">
                                                <el-option v-for="item in isReturn_list" :key="item.value"
                                                    :label="item.label" :value="item.value" />
                                            </el-select>
                                        </el-form-item>
                                        <el-collapse>
                                            <el-collapse-item title="显示更多选填信息" name="1">

                                                <el-form-item label="备注" :required="false">
                                                    <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                        placeholder="请输入备注" v-model="add_data.remark" />
                                                </el-form-item>
                                            </el-collapse-item>

                                        </el-collapse>







                                    </el-form>
                                </el-tab-pane>
                                <el-tab-pane :label="'送' + bus_name" name="aircraft_deliver">
                                    <el-form :model="add_data" label-width="110px" label-suffix="：">


                                        <div style="display:flex;">
                                            <!-- <el-button @click="land_se_btn" style="margin-left:20px"
                                                type="primary">航班号自动查询</el-button> -->
                                            <el-form-item label="送车时间" :required="false">
                                                <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                    format="YYYY-MM-DD HH:mm" v-model="add_data.landDate" type="datetime"
                                                    placeholder="请选择送车时间" />
                                            </el-form-item>


                                        </div>
                                        <div style="display:flex;">
                                            <el-form-item label="接人地址" :required="false">
                                                <el-select @change="select_Btn" v-model="add_data.toLocation" class="m-2"
                                                    placeholder="请选择接人地址" size="large">
                                                    <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                        :label="item.stationName" :value="item.stationName" />
                                                </el-select>
                                            </el-form-item>
                                            <el-button @click="map_off_btn" style="margin-left:30px;margin-bottom:10px"
                                                type="primary">地图选址</el-button>
                                        </div>

                                        <template v-if="passing_points_list.length > 0">
                                            <el-form-item v-for="(item, index) in passing_points_index" :key="index"
                                                label="途经地点：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div
                                                        style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                        {{
                                                            passing_points_list[index].area + '-' +
                                                            passing_points_list[index].name
                                                        }}</div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="passing_points_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="删除途经">
                                                            删除途经
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <div style="display:flex;width:35vw;">

                                            <el-form-item label="送车地点" :required="false">
                                                <div @click="car_map_btn(1)">
                                                    <el-input style="width:220px" v-model="add_data.toLocation"
                                                        placeholder="请选择送车地点" />
                                                </div>
                                                <el-radio-group v-if="chartered_bus_off" v-model="aircraft_radio"
                                                    style="margin-left:20px;">
                                                    <el-radio label="拼车" size="large">拼车</el-radio>
                                                    <el-radio label="包车" size="large">包车</el-radio>
                                                </el-radio-group>
                                                <el-button style="margin-left:30px;margin-bottom:0px"
                                                    @click="add_passing_points(1)" type="warning">添加途经点</el-button>
                                            </el-form-item>

                                        </div>
                                        <el-form-item type="number" label="预约人数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.personNum"
                                                placeholder="请输入预约人数" />
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="指定车型" :required="false">
                                            <el-select v-model="add_data.needSeats" :filterable="false"
                                                placeholder="请选择指定车型" style="width: 220px;">
                                                <el-option label="5座" value="5"></el-option>
                                                <el-option label="7座" value="7"></el-option>
                                                <el-option label="9座" value="9"></el-option>
                                                <el-option label="12座" value="12"></el-option>
                                                <el-option label="14座" value="14"></el-option>
                                                <el-option label="17座" value="17"></el-option>
                                                <el-option label="30座" value="30"></el-option>
                                                <el-option label="39座" value="39"></el-option>
                                                <el-option label="49座" value="49"></el-option>
                                                <el-option label="55座" value="55"></el-option>

                                            </el-select>
                                        </el-form-item>
                                        <el-form-item v-if="aircraft_radio != '拼车'" label="包车天数" :required="false">
                                            <el-input style="width:220px" v-model="add_data.days" placeholder="请输入包车天数" />
                                        </el-form-item>
                                        <div style="display:flex;" v-if="aircraft_radio != '拼车'">
                                            <el-form-item label="包车价格" :required="false">
                                                <el-input style="width:220px" v-model="add_data.price"
                                                    placeholder="请输入包车价格" />
                                            </el-form-item>

                                            <!-- <el-button icon="PieChart" @click="price_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px"
                                                type="primary">自动计算价格</el-button> -->
                                        </div>

                                        <el-form-item v-if="aircraft_radio != '拼车'" label="是否走高速" :required="false">
                                            <el-select v-model="add_data.isHighSpeed" :filterable="false"
                                                placeholder="请选择是否走高速" style="width: 220px;">
                                                <el-option label="走高速" value="1"></el-option>
                                                <el-option label="不走高速" value="0"></el-option>

                                            </el-select>
                                        </el-form-item>

                                        <el-form-item label="联系人姓名" :required="false">
                                            <el-input style="width:220px" v-model="add_data.cusName"
                                                placeholder="请输入联系人姓名" />
                                        </el-form-item>
                                        <div style="display:flex;">
                                            <el-form-item type="number" label="联系人电话" :required="false">
                                                <el-input style="width:220px" v-model="add_data.cusMobile"
                                                    placeholder="请输入联系人电话" />
                                            </el-form-item>
                                            <el-button v-if="aircraft_radio != '拼车'" @click="add_cusName_btn(1)"
                                                style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                        </div>
                                        <template v-if="add_cusName_list.length > 0">
                                            <el-form-item v-for="(item, index) in add_cusName_index" :key="index"
                                                label="联系人：">
                                                <!-- @click="choseMapPoint" -->
                                                <div style="display: flex;">
                                                    <div style="display: flex;">
                                                        <el-input style="width:220px" v-model="add_cusName_list[index].name"
                                                            placeholder="请输入联系人姓名" />
                                                        <el-input style="width:220px"
                                                            v-model="add_cusName_list[index].mobile"
                                                            placeholder="请输入联系人电话" />
                                                    </div>

                                                    <div style="margin-left: 40px;">
                                                        <el-button @click="add_cusName_index_delbtn(index)" type="danger"
                                                            icon="Close" plain size="mini" title="联系人">
                                                            联系人
                                                        </el-button>
                                                    </div>
                                                </div>
                                            </el-form-item>
                                        </template>
                                        <el-form-item label="是否返程" :required="false">
                                            <el-select @change="isReturnAdd_change" style="width:220px"
                                                v-model="add_data.isReturnAdd" placeholder="请选择是否返程">
                                                <el-option v-for="item in isReturn_list" :key="item.value"
                                                    :label="item.label" :value="item.value" />
                                            </el-select>
                                        </el-form-item>
                                        <el-collapse>
                                            <el-collapse-item title="显示更多选填信息" name="1">

                                                <el-form-item label="备注" :required="false">
                                                    <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                        placeholder="请输入备注" v-model="add_data.remark" />
                                                </el-form-item>
                                            </el-collapse-item>

                                        </el-collapse>







                                    </el-form>
                                </el-tab-pane>
                            </el-tabs>
                        </el-tab-pane>
                    </el-tabs>



                    <el-button @click="ok_btn" style="margin-left:30vw;margin-top:10px" type="primary">确认提交</el-button>
                </div>

                <!-- 返程 -->
                <el-divider v-if="add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是'" style="height:70vh;"
                    direction="vertical" />
                <!-- 返程 -->
                <div style="margin-left:20px" v-if="add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是'"
                    :style="add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是' ? 'width:40%' : ''">
                    <!-- 飞机返程 -->
                    <div v-if="activeName_tabs1 == 'aircraft'">
                        <div style="font-size:20px;font-weight:700;">返程信息: <text
                                style="font-size:20px;font-weight:700;color:red ;">
                                {{ activeName_tabs2 == "aircraft_connect" ? '送飞机' : '接飞机' }}</text></div>
                        <div style="margin-top:40px;">
                            <div v-if="activeName_tabs2 == 'aircraft_connect'">
                                <el-form :model="add_data" label-width="110px" label-suffix="：">

                                    <div style="display:flex;">
                                        <el-button @click="land_se_btn(2)" style="margin-left:20px"
                                            type="primary">航班号自动查询</el-button>
                                        <el-form-item label="送机时间" :required="false">
                                            <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                format="YYYY-MM-DD HH:mm" v-model="add_data.returnOrder.flightDate"
                                                type="datetime" placeholder="请选择送机时间" />
                                        </el-form-item>


                                    </div>
                                    <div style="display:flex;">
                                        <!-- <el-form-item label="接人地址" :required="false">
                                                <el-autocomplete v-model="add_data.fromLocation" :fetch-suggestions="toLocation_querySearch"
                                                    :trigger-on-focus="false" clearable class="inline-input w-50" placeholder="请输入接人地址"
                                                    @select="toLocation_handleSelect" />
                                            </el-form-item> -->
                                        <el-form-item label="接人地址" :required="false">
                                            <el-select @change="select_Btn2" v-model="add_data.returnOrder.fromLocation"
                                                class="m-2" placeholder="请输入接人地址" size="large">
                                                <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                    :label="item.stationName" :value="item.stationName" />
                                            </el-select>
                                        </el-form-item>
                                        <el-button @click="map_off_btn(2)" style="margin-left:30px;margin-bottom:10px"
                                            type="primary">地图选址</el-button>


                                    </div>
                                    <template v-if="passing_points_list2.length > 0">
                                        <el-form-item v-for="(item, index) in passing_points_index2" :key="index"
                                            label="途经地点：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div
                                                    style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                    {{
                                                        passing_points_list2[index].area + '-' +
                                                        passing_points_list2[index].name
                                                    }}</div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="passing_points_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="删除途经">
                                                        删除途经
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                    <div style="display:flex;">
                                        <el-form-item label="送机地点" :required="false">
                                            <el-select style="width:150px" @change="aircraft_connect_change2"
                                                v-model="add_data.returnOrder.toLocation" placeholder="请选择送机地点" clearable>
                                                <el-option v-for="item in aircraft_list" :key="item.id"
                                                    :label="item.station_name" :value="item.station_name" />
                                            </el-select>
                                            <el-radio-group v-if="chartered_bus_off2" v-model="aircraft_radio2"
                                                style="margin-left:20px;">
                                                <el-radio label="拼车" size="large">拼车</el-radio>
                                                <el-radio label="包车" size="large">包车</el-radio>
                                            </el-radio-group>
                                            <el-button style="margin-left:30px;margin-bottom:0px"
                                                @click="add_passing_points(2)" type="warning">添加途经点</el-button>
                                        </el-form-item>

                                    </div>

                                    <el-form-item type="number" label="预约人数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.personNum"
                                            placeholder="请输入预约人数" />
                                    </el-form-item>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="指定车型" :required="false">
                                        <el-select v-model="add_data.returnOrder.needSeats" :filterable="false"
                                            placeholder="请选择指定车型" style="width: 220px;">
                                            <el-option label="5座" value="5"></el-option>
                                            <el-option label="7座" value="7"></el-option>
                                            <el-option label="9座" value="9"></el-option>
                                            <el-option label="12座" value="12"></el-option>
                                            <el-option label="14座" value="14"></el-option>
                                            <el-option label="17座" value="17"></el-option>
                                            <el-option label="30座" value="30"></el-option>
                                            <el-option label="39座" value="39"></el-option>
                                            <el-option label="49座" value="49"></el-option>
                                            <el-option label="55座" value="55"></el-option>

                                        </el-select>
                                    </el-form-item>
                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="包车天数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.days"
                                            placeholder="请输入包车天数" />
                                    </el-form-item>
                                    <div style="display:flex;" v-if="aircraft_radio2 != '拼车'">
                                        <el-form-item label="包车价格" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.price"
                                                placeholder="请输入包车价格" />
                                        </el-form-item>

                                        <!-- <el-button icon="PieChart" @click="price_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="primary">自动计算价格</el-button> -->
                                    </div>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="是否走高速" :required="false">
                                        <el-select v-model="add_data.returnOrder.isHighSpeed" :filterable="false"
                                            placeholder="请选择是否走高速" style="width: 220px;">
                                            <el-option label="走高速" value="1"></el-option>
                                            <el-option label="不走高速" value="0"></el-option>

                                        </el-select>
                                    </el-form-item>

                                    <el-form-item label="联系人姓名" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.cusName"
                                            placeholder="请输入联系人姓名" />
                                    </el-form-item>
                                    <div style="display:flex">
                                        <el-form-item type="number" label="联系人电话" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.cusMobile"
                                                placeholder="请输入联系人电话" />
                                        </el-form-item>
                                        <el-button v-if="aircraft_radio2 != '拼车'" @click="add_cusName_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                    </div>
                                    <template v-if="add_cusName_list2.length > 0">
                                        <el-form-item v-for="(item, index) in add_cusName_index2" :key="index" label="联系人：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div style="display: flex;">
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].name"
                                                        placeholder="请输入联系人姓名" />
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].mobile"
                                                        placeholder="请输入联系人电话" />
                                                </div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="add_cusName_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="联系人">
                                                        联系人
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                </el-form>
                                <el-collapse>
                                    <el-collapse-item title="显示更多选填信息" name="1">

                                        <el-form-item label="备注" :required="false">
                                            <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                placeholder="请输入备注" v-model="add_data.returnOrder.remark" />
                                        </el-form-item>
                                    </el-collapse-item>

                                </el-collapse>
                            </div>
                            <div v-if="activeName_tabs2 == 'aircraft_deliver'">
                                <el-form :model="add_data" label-width="110px" label-suffix="：">

                                    <div style="display:flex;">
                                        <el-button @click="land_se_btn(2)" style="margin-left:20px"
                                            type="primary">航班号自动查询</el-button>
                                        <el-form-item label="送机时间" :required="false">
                                            <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                format="YYYY-MM-DD HH:mm" v-model="add_data.returnOrder.flightDate"
                                                type="datetime" placeholder="请选择送机时间" />
                                        </el-form-item>


                                    </div>
                                    <div style="display:flex;">
                                        <el-form-item label="接机地点" :required="false">
                                            <el-select style="width:150px" @change="aircraft_connect_change2"
                                                v-model="add_data.returnOrder.fromLocation" placeholder="请选择接机地点" clearable>
                                                <el-option v-for="item in aircraft_list" :key="item.id"
                                                    :label="item.station_name" :value="item.station_name" />
                                            </el-select>
                                            <el-radio-group v-if="chartered_bus_off2" v-model="aircraft_radio2"
                                                style="margin-left:20px;">
                                                <el-radio label="拼车" size="large">拼车</el-radio>
                                                <el-radio label="包车" size="large">包车</el-radio>
                                            </el-radio-group>
                                            <el-button style="margin-left:30px;margin-bottom:0px"
                                                @click="add_passing_points(2)" type="warning">添加途经点</el-button>
                                        </el-form-item>

                                    </div>
                                    <template v-if="passing_points_list2.length > 0">
                                        <el-form-item v-for="(item, index) in passing_points_index2" :key="index"
                                            label="途经地点：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div
                                                    style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                    {{
                                                        passing_points_list2[index].area + '-' +
                                                        passing_points_list2[index].name
                                                    }}</div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="passing_points_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="删除途经">
                                                        删除途经
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                    <div style="display:flex;">

                                        <el-form-item label="送人地址" :required="false">
                                            <el-select @change="select_Btn2" v-model="add_data.returnOrder.toLocation"
                                                class="m-2" placeholder="请输入送人地址" size="large">
                                                <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                    :label="item.stationName" :value="item.stationName" />
                                            </el-select>
                                        </el-form-item>
                                        <el-button @click="map_off_btn(2)" style="margin-left:30px;margin-bottom:10px"
                                            type="primary">地图选址</el-button>


                                    </div>


                                    <el-form-item type="number" label="预约人数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.personNum"
                                            placeholder="请输入预约人数" />
                                    </el-form-item>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="指定车型" :required="false">
                                        <el-select v-model="add_data.returnOrder.needSeats" :filterable="false"
                                            placeholder="请选择指定车型" style="width: 220px;">
                                            <el-option label="5座" value="5"></el-option>
                                            <el-option label="7座" value="7"></el-option>
                                            <el-option label="9座" value="9"></el-option>
                                            <el-option label="12座" value="12"></el-option>
                                            <el-option label="14座" value="14"></el-option>
                                            <el-option label="17座" value="17"></el-option>
                                            <el-option label="30座" value="30"></el-option>
                                            <el-option label="39座" value="39"></el-option>
                                            <el-option label="49座" value="49"></el-option>
                                            <el-option label="55座" value="55"></el-option>

                                        </el-select>
                                    </el-form-item>
                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="包车天数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.days"
                                            placeholder="请输入包车天数" />
                                    </el-form-item>
                                    <div style="display:flex;" v-if="aircraft_radio2 != '拼车'">
                                        <el-form-item label="包车价格" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.price"
                                                placeholder="请输入包车价格" />
                                        </el-form-item>

                                        <!-- <el-button icon="PieChart" @click="price_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="primary">自动计算价格</el-button> -->
                                    </div>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="是否走高速" :required="false">
                                        <el-select v-model="add_data.returnOrder.isHighSpeed" :filterable="false"
                                            placeholder="请选择是否走高速" style="width: 220px;">
                                            <el-option label="走高速" value="1"></el-option>
                                            <el-option label="不走高速" value="0"></el-option>

                                        </el-select>
                                    </el-form-item>

                                    <el-form-item label="联系人姓名" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.cusName"
                                            placeholder="请输入联系人姓名" />
                                    </el-form-item>
                                    <div style="display:flex">
                                        <el-form-item type="number" label="联系人电话" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.cusMobile"
                                                placeholder="请输入联系人电话" />
                                        </el-form-item>
                                        <el-button v-if="aircraft_radio2 != '拼车'" @click="add_cusName_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                    </div>
                                    <template v-if="add_cusName_list2.length > 0">
                                        <el-form-item v-for="(item, index) in add_cusName_index2" :key="index" label="联系人：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div style="display: flex;">
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].name"
                                                        placeholder="请输入联系人姓名" />
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].mobile"
                                                        placeholder="请输入联系人电话" />
                                                </div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="add_cusName_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="联系人">
                                                        联系人
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                </el-form>
                                <el-collapse>
                                    <el-collapse-item title="显示更多选填信息" name="1">

                                        <el-form-item label="备注" :required="false">
                                            <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                placeholder="请输入备注" v-model="add_data.returnOrder.remark" />
                                        </el-form-item>
                                    </el-collapse-item>

                                </el-collapse>
                            </div>
                        </div>
                    </div>
                    <!-- 火车返程 -->
                    <div v-if="activeName_tabs1 == 'train'">
                        <div style="font-size:20px;font-weight:700;">返程信息: <text
                                style="font-size:20px;font-weight:700;color:red ;">
                                {{ activeName_tabs2 == "aircraft_connect" ? '送火车' : '接火车' }}</text></div>
                        <div style="margin-top:40px;">
                            <div v-if="activeName_tabs2 == 'aircraft_connect'">
                                <el-form :model="add_data" label-width="110px" label-suffix="：">

                                    <div style="display:flex;">
                                        <!-- <el-button @click="land_se_btn(2)" style="margin-left:20px"
                                            type="primary">航班号自动查询</el-button> -->
                                        <el-form-item label="送火车时间" :required="false">
                                            <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                format="YYYY-MM-DD HH:mm" v-model="add_data.returnOrder.flightDate"
                                                type="datetime" placeholder="请选择送火车时间" />
                                        </el-form-item>


                                    </div>
                                    <div style="display:flex;">
                                        <!-- <el-form-item label="接人地址" :required="false">
                                                <el-autocomplete v-model="add_data.fromLocation" :fetch-suggestions="toLocation_querySearch"
                                                    :trigger-on-focus="false" clearable class="inline-input w-50" placeholder="请输入接人地址"
                                                    @select="toLocation_handleSelect" />
                                            </el-form-item> -->
                                        <el-form-item label="接人地址" :required="false">
                                            <el-select @change="select_Btn2" v-model="add_data.returnOrder.fromLocation"
                                                class="m-2" placeholder="请输入接人地址" size="large">
                                                <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                    :label="item.stationName" :value="item.stationName" />
                                            </el-select>
                                        </el-form-item>
                                        <el-button @click="map_off_btn(2)" style="margin-left:30px;margin-bottom:10px"
                                            type="primary">地图选址</el-button>


                                    </div>
                                    <template v-if="passing_points_list2.length > 0">
                                        <el-form-item v-for="(item, index) in passing_points_index2" :key="index"
                                            label="途经地点：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div
                                                    style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                    {{
                                                        passing_points_list2[index].area + '-' +
                                                        passing_points_list2[index].name
                                                    }}</div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="passing_points_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="删除途经">
                                                        删除途经
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                    <div style="display:flex;">
                                        <el-form-item label="送火车地点" :required="false">
                                            <el-select style="width:150px" @change="aircraft_connect_change2"
                                                v-model="add_data.returnOrder.toLocation" placeholder="请选择送火车地点" clearable>
                                                <el-option v-for="item in train_list" :key="item.id"
                                                    :label="item.station_name" :value="item.station_name" />
                                            </el-select>
                                            <el-radio-group v-if="chartered_bus_off2" v-model="aircraft_radio2"
                                                style="margin-left:20px;">
                                                <el-radio label="拼车" size="large">拼车</el-radio>
                                                <el-radio label="包车" size="large">包车</el-radio>
                                            </el-radio-group>
                                            <el-button style="margin-left:30px;margin-bottom:0px"
                                                @click="add_passing_points(2)" type="warning">添加途经点</el-button>
                                        </el-form-item>

                                    </div>

                                    <el-form-item type="number" label="预约人数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.personNum"
                                            placeholder="请输入预约人数" />
                                    </el-form-item>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="指定车型" :required="false">
                                        <el-select v-model="add_data.returnOrder.needSeats" :filterable="false"
                                            placeholder="请选择指定车型" style="width: 220px;">
                                            <el-option label="5座" value="5"></el-option>
                                            <el-option label="7座" value="7"></el-option>
                                            <el-option label="9座" value="9"></el-option>
                                            <el-option label="12座" value="12"></el-option>
                                            <el-option label="14座" value="14"></el-option>
                                            <el-option label="17座" value="17"></el-option>
                                            <el-option label="30座" value="30"></el-option>
                                            <el-option label="39座" value="39"></el-option>
                                            <el-option label="49座" value="49"></el-option>
                                            <el-option label="55座" value="55"></el-option>

                                        </el-select>
                                    </el-form-item>
                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="包车天数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.days"
                                            placeholder="请输入包车天数" />
                                    </el-form-item>
                                    <div style="display:flex;" v-if="aircraft_radio2 != '拼车'">
                                        <el-form-item label="包车价格" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.price"
                                                placeholder="请输入包车价格" />
                                        </el-form-item>

                                        <!-- <el-button icon="PieChart" @click="price_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="primary">自动计算价格</el-button> -->
                                    </div>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="是否走高速" :required="false">
                                        <el-select v-model="add_data.returnOrder.isHighSpeed" :filterable="false"
                                            placeholder="请选择是否走高速" style="width: 220px;">
                                            <el-option label="走高速" value="1"></el-option>
                                            <el-option label="不走高速" value="0"></el-option>

                                        </el-select>
                                    </el-form-item>

                                    <el-form-item label="联系人姓名" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.cusName"
                                            placeholder="请输入联系人姓名" />
                                    </el-form-item>
                                    <div style="display:flex">
                                        <el-form-item type="number" label="联系人电话" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.cusMobile"
                                                placeholder="请输入联系人电话" />
                                        </el-form-item>
                                        <el-button v-if="aircraft_radio2 != '拼车'" @click="add_cusName_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                    </div>
                                    <template v-if="add_cusName_list2.length > 0">
                                        <el-form-item v-for="(item, index) in add_cusName_index2" :key="index" label="联系人：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div style="display: flex;">
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].name"
                                                        placeholder="请输入联系人姓名" />
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].mobile"
                                                        placeholder="请输入联系人电话" />
                                                </div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="add_cusName_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="联系人">
                                                        联系人
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                </el-form>
                                <el-collapse>
                                    <el-collapse-item title="显示更多选填信息" name="1">

                                        <el-form-item label="备注" :required="false">
                                            <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                placeholder="请输入备注" v-model="add_data.returnOrder.remark" />
                                        </el-form-item>
                                    </el-collapse-item>

                                </el-collapse>
                            </div>
                            <div v-if="activeName_tabs2 == 'aircraft_deliver'">
                                <el-form :model="add_data" label-width="110px" label-suffix="：">

                                    <div style="display:flex;">
                                        <!-- <el-button @click="land_se_btn(2)" style="margin-left:20px"
                                            type="primary">航班号自动查询</el-button> -->
                                        <el-form-item label="送火车时间" :required="false">
                                            <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                format="YYYY-MM-DD HH:mm" v-model="add_data.returnOrder.flightDate"
                                                type="datetime" placeholder="请选择送火车时间" />
                                        </el-form-item>


                                    </div>
                                    <div style="display:flex;">
                                        <el-form-item label="接火车地点" :required="false">
                                            <el-select style="width:150px" @change="aircraft_connect_change2"
                                                v-model="add_data.returnOrder.fromLocation" placeholder="请选择接火车地点"
                                                clearable>
                                                <el-option v-for="item in train_list" :key="item.id"
                                                    :label="item.station_name" :value="item.station_name" />
                                            </el-select>
                                            <el-radio-group v-if="chartered_bus_off2" v-model="aircraft_radio2"
                                                style="margin-left:20px;">
                                                <el-radio label="拼车" size="large">拼车</el-radio>
                                                <el-radio label="包车" size="large">包车</el-radio>
                                            </el-radio-group>
                                            <el-button style="margin-left:30px;margin-bottom:0px"
                                                @click="add_passing_points(2)" type="warning">添加途经点</el-button>
                                        </el-form-item>

                                    </div>
                                    <template v-if="passing_points_list2.length > 0">
                                        <el-form-item v-for="(item, index) in passing_points_index2" :key="index"
                                            label="途经地点：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div
                                                    style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                    {{
                                                        passing_points_list2[index].area + '-' +
                                                        passing_points_list2[index].name
                                                    }}</div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="passing_points_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="删除途经">
                                                        删除途经
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                    <div style="display:flex;">

                                        <el-form-item label="送人地址" :required="false">
                                            <el-select @change="select_Btn2" v-model="add_data.returnOrder.toLocation"
                                                class="m-2" placeholder="请输入送人地址" size="large">
                                                <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                    :label="item.stationName" :value="item.stationName" />
                                            </el-select>
                                        </el-form-item>
                                        <el-button @click="map_off_btn(2)" style="margin-left:30px;margin-bottom:10px"
                                            type="primary">地图选址</el-button>


                                    </div>


                                    <el-form-item type="number" label="预约人数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.personNum"
                                            placeholder="请输入预约人数" />
                                    </el-form-item>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="指定车型" :required="false">
                                        <el-select v-model="add_data.returnOrder.needSeats" :filterable="false"
                                            placeholder="请选择指定车型" style="width: 220px;">
                                            <el-option label="5座" value="5"></el-option>
                                            <el-option label="7座" value="7"></el-option>
                                            <el-option label="9座" value="9"></el-option>
                                            <el-option label="12座" value="12"></el-option>
                                            <el-option label="14座" value="14"></el-option>
                                            <el-option label="17座" value="17"></el-option>
                                            <el-option label="30座" value="30"></el-option>
                                            <el-option label="39座" value="39"></el-option>
                                            <el-option label="49座" value="49"></el-option>
                                            <el-option label="55座" value="55"></el-option>

                                        </el-select>
                                    </el-form-item>
                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="包车天数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.days"
                                            placeholder="请输入包车天数" />
                                    </el-form-item>
                                    <div style="display:flex;" v-if="aircraft_radio2 != '拼车'">
                                        <el-form-item label="包车价格" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.price"
                                                placeholder="请输入包车价格" />
                                        </el-form-item>

                                        <!-- <el-button icon="PieChart" @click="price_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="primary">自动计算价格</el-button> -->
                                    </div>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="是否走高速" :required="false">
                                        <el-select v-model="add_data.returnOrder.isHighSpeed" :filterable="false"
                                            placeholder="请选择是否走高速" style="width: 220px;">
                                            <el-option label="走高速" value="1"></el-option>
                                            <el-option label="不走高速" value="0"></el-option>

                                        </el-select>
                                    </el-form-item>

                                    <el-form-item label="联系人姓名" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.cusName"
                                            placeholder="请输入联系人姓名" />
                                    </el-form-item>
                                    <div style="display:flex">
                                        <el-form-item type="number" label="联系人电话" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.cusMobile"
                                                placeholder="请输入联系人电话" />
                                        </el-form-item>
                                        <el-button v-if="aircraft_radio2 != '拼车'" @click="add_cusName_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                    </div>
                                    <template v-if="add_cusName_list2.length > 0">
                                        <el-form-item v-for="(item, index) in add_cusName_index2" :key="index" label="联系人：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div style="display: flex;">
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].name"
                                                        placeholder="请输入联系人姓名" />
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].mobile"
                                                        placeholder="请输入联系人电话" />
                                                </div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="add_cusName_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="联系人">
                                                        联系人
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                </el-form>
                                <el-collapse>
                                    <el-collapse-item title="显示更多选填信息" name="1">

                                        <el-form-item label="备注" :required="false">
                                            <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                placeholder="请输入备注" v-model="add_data.returnOrder.remark" />
                                        </el-form-item>
                                    </el-collapse-item>

                                </el-collapse>
                            </div>
                        </div>
                    </div>
                    <!-- 返程大巴 -->
                    <div v-if="activeName_tabs1 == 'bus'">
                        <div style="font-size:20px;font-weight:700;">返程信息: <text
                                style="font-size:20px;font-weight:700;color:red ;">
                                {{ activeName_tabs2 == "aircraft_connect" ? '送大巴' : '接大巴' }}</text></div>
                        <div style="margin-top:40px;">
                            <div v-if="activeName_tabs2 == 'aircraft_connect'">
                                <el-form :model="add_data" label-width="110px" label-suffix="：">

                                    <div style="display:flex;">
                                        <!-- <el-button @click="land_se_btn(2)" style="margin-left:20px"
                                            type="primary">航班号自动查询</el-button> -->
                                        <el-form-item label="送大巴时间" :required="false">
                                            <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                format="YYYY-MM-DD HH:mm" v-model="add_data.returnOrder.flightDate"
                                                type="datetime" placeholder="请选择送大巴时间" />
                                        </el-form-item>


                                    </div>
                                    <div style="display:flex;">
                                        <!-- <el-form-item label="接人地址" :required="false">
                                                <el-autocomplete v-model="add_data.fromLocation" :fetch-suggestions="toLocation_querySearch"
                                                    :trigger-on-focus="false" clearable class="inline-input w-50" placeholder="请输入接人地址"
                                                    @select="toLocation_handleSelect" />
                                            </el-form-item> -->
                                        <el-form-item label="接人地址" :required="false">
                                            <el-select @change="select_Btn2" v-model="add_data.returnOrder.fromLocation"
                                                class="m-2" placeholder="请输入接人地址" size="large">
                                                <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                    :label="item.stationName" :value="item.stationName" />
                                            </el-select>
                                        </el-form-item>
                                        <el-button @click="map_off_btn(2)" style="margin-left:30px;margin-bottom:10px"
                                            type="primary">地图选址</el-button>


                                    </div>
                                    <template v-if="passing_points_list2.length > 0">
                                        <el-form-item v-for="(item, index) in passing_points_index2" :key="index"
                                            label="途经地点：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div
                                                    style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                    {{
                                                        passing_points_list2[index].area + '-' +
                                                        passing_points_list2[index].name
                                                    }}</div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="passing_points_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="删除途经">
                                                        删除途经
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                    <div style="display:flex;">
                                        <el-form-item label="送大巴地点" :required="false">
                                            <div @click="car_map_btn(2)">
                                                <el-input style="width:220px" v-model="add_data.returnOrder.toLocation"
                                                    placeholder="请选择送车地点" />
                                            </div>

                                            <el-radio-group v-if="chartered_bus_off2" v-model="aircraft_radio2"
                                                style="margin-left:20px;">
                                                <el-radio label="拼车" size="large">拼车</el-radio>
                                                <el-radio label="包车" size="large">包车</el-radio>
                                            </el-radio-group>
                                            <el-button style="margin-left:30px;margin-bottom:0px"
                                                @click="add_passing_points(2)" type="warning">添加途经点</el-button>
                                        </el-form-item>

                                    </div>

                                    <el-form-item type="number" label="预约人数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.personNum"
                                            placeholder="请输入预约人数" />
                                    </el-form-item>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="指定车型" :required="false">
                                        <el-select v-model="add_data.returnOrder.needSeats" :filterable="false"
                                            placeholder="请选择指定车型" style="width: 220px;">
                                            <el-option label="5座" value="5"></el-option>
                                            <el-option label="7座" value="7"></el-option>
                                            <el-option label="9座" value="9"></el-option>
                                            <el-option label="12座" value="12"></el-option>
                                            <el-option label="14座" value="14"></el-option>
                                            <el-option label="17座" value="17"></el-option>
                                            <el-option label="30座" value="30"></el-option>
                                            <el-option label="39座" value="39"></el-option>
                                            <el-option label="49座" value="49"></el-option>
                                            <el-option label="55座" value="55"></el-option>

                                        </el-select>
                                    </el-form-item>
                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="包车天数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.days"
                                            placeholder="请输入包车天数" />
                                    </el-form-item>
                                    <div style="display:flex;" v-if="aircraft_radio2 != '拼车'">
                                        <el-form-item label="包车价格" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.price"
                                                placeholder="请输入包车价格" />
                                        </el-form-item>

                                        <!-- <el-button icon="PieChart" @click="price_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="primary">自动计算价格</el-button> -->
                                    </div>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="是否走高速" :required="false">
                                        <el-select v-model="add_data.returnOrder.isHighSpeed" :filterable="false"
                                            placeholder="请选择是否走高速" style="width: 220px;">
                                            <el-option label="走高速" value="1"></el-option>
                                            <el-option label="不走高速" value="0"></el-option>

                                        </el-select>
                                    </el-form-item>

                                    <el-form-item label="联系人姓名" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.cusName"
                                            placeholder="请输入联系人姓名" />
                                    </el-form-item>
                                    <div style="display:flex">
                                        <el-form-item type="number" label="联系人电话" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.cusMobile"
                                                placeholder="请输入联系人电话" />
                                        </el-form-item>
                                        <el-button v-if="aircraft_radio2 != '拼车'" @click="add_cusName_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                    </div>
                                    <template v-if="add_cusName_list2.length > 0">
                                        <el-form-item v-for="(item, index) in add_cusName_index2" :key="index" label="联系人：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div style="display: flex;">
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].name"
                                                        placeholder="请输入联系人姓名" />
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].mobile"
                                                        placeholder="请输入联系人电话" />
                                                </div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="add_cusName_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="联系人">
                                                        联系人
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                </el-form>
                                <el-collapse>
                                    <el-collapse-item title="显示更多选填信息" name="1">

                                        <el-form-item label="备注" :required="false">
                                            <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                placeholder="请输入备注" v-model="add_data.returnOrder.remark" />
                                        </el-form-item>
                                    </el-collapse-item>

                                </el-collapse>
                            </div>
                            <div v-if="activeName_tabs2 == 'aircraft_deliver'">
                                <el-form :model="add_data" label-width="110px" label-suffix="：">

                                    <div style="display:flex;">
                                        <!-- <el-button @click="land_se_btn(2)" style="margin-left:20px"
                                            type="primary">航班号自动查询</el-button> -->
                                        <el-form-item label="送大巴时间" :required="false">
                                            <el-date-picker style=" width: 160px" value-format="YYYY-MM-DD HH:mm"
                                                format="YYYY-MM-DD HH:mm" v-model="add_data.returnOrder.flightDate"
                                                type="datetime" placeholder="请选择送大巴时间" />
                                        </el-form-item>


                                    </div>
                                    <div style="display:flex;">
                                        <el-form-item label="接大巴地点" :required="false">
                                            <div @click="car_map_btn(2)">
                                                <el-input style="width:220px" v-model="add_data.returnOrder.fromLocation"
                                                    placeholder="请选择接大巴地点" />
                                            </div>

                                            <el-radio-group v-if="chartered_bus_off2" v-model="aircraft_radio2"
                                                style="margin-left:20px;">
                                                <el-radio label="拼车" size="large">拼车</el-radio>
                                                <el-radio label="包车" size="large">包车</el-radio>
                                            </el-radio-group>
                                            <el-button style="margin-left:30px;margin-bottom:0px"
                                                @click="add_passing_points(2)" type="warning">添加途经点</el-button>
                                        </el-form-item>

                                    </div>
                                    <template v-if="passing_points_list2.length > 0">
                                        <el-form-item v-for="(item, index) in passing_points_index2" :key="index"
                                            label="途经地点：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div
                                                    style="color:#108EE9;width:230px;overflow: hidden;white-space: nowrap;">
                                                    {{
                                                        passing_points_list2[index].area + '-' +
                                                        passing_points_list2[index].name
                                                    }}</div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="passing_points_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="删除途经">
                                                        删除途经
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                    <div style="display:flex;">

                                        <el-form-item label="送人地址" :required="false">
                                            <el-select @change="select_Btn2" v-model="add_data.returnOrder.toLocation"
                                                class="m-2" placeholder="请输入送人地址" size="large">
                                                <el-option v-for="item in getStationList_Data" :key="item.stationName"
                                                    :label="item.stationName" :value="item.stationName" />
                                            </el-select>
                                        </el-form-item>
                                        <el-button @click="map_off_btn(2)" style="margin-left:30px;margin-bottom:10px"
                                            type="primary">地图选址</el-button>


                                    </div>


                                    <el-form-item type="number" label="预约人数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.personNum"
                                            placeholder="请输入预约人数" />
                                    </el-form-item>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="指定车型" :required="false">
                                        <el-select v-model="add_data.returnOrder.needSeats" :filterable="false"
                                            placeholder="请选择指定车型" style="width: 220px;">
                                            <el-option label="5座" value="5"></el-option>
                                            <el-option label="7座" value="7"></el-option>
                                            <el-option label="9座" value="9"></el-option>
                                            <el-option label="12座" value="12"></el-option>
                                            <el-option label="14座" value="14"></el-option>
                                            <el-option label="17座" value="17"></el-option>
                                            <el-option label="30座" value="30"></el-option>
                                            <el-option label="39座" value="39"></el-option>
                                            <el-option label="49座" value="49"></el-option>
                                            <el-option label="55座" value="55"></el-option>

                                        </el-select>
                                    </el-form-item>
                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="包车天数" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.days"
                                            placeholder="请输入包车天数" />
                                    </el-form-item>
                                    <div style="display:flex;" v-if="aircraft_radio2 != '拼车'">
                                        <el-form-item label="包车价格" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.price"
                                                placeholder="请输入包车价格" />
                                        </el-form-item>

                                        <!-- <el-button icon="PieChart" @click="price_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="primary">自动计算价格</el-button> -->
                                    </div>

                                    <el-form-item v-if="aircraft_radio2 != '拼车'" label="是否走高速" :required="false">
                                        <el-select v-model="add_data.returnOrder.isHighSpeed" :filterable="false"
                                            placeholder="请选择是否走高速" style="width: 220px;">
                                            <el-option label="走高速" value="1"></el-option>
                                            <el-option label="不走高速" value="0"></el-option>

                                        </el-select>
                                    </el-form-item>

                                    <el-form-item label="联系人姓名" :required="false">
                                        <el-input style="width:220px" v-model="add_data.returnOrder.cusName"
                                            placeholder="请输入联系人姓名" />
                                    </el-form-item>
                                    <div style="display:flex">
                                        <el-form-item type="number" label="联系人电话" :required="false">
                                            <el-input style="width:220px" v-model="add_data.returnOrder.cusMobile"
                                                placeholder="请输入联系人电话" />
                                        </el-form-item>
                                        <el-button v-if="aircraft_radio2 != '拼车'" @click="add_cusName_btn(2)"
                                            style="margin-left:30px;margin-bottom:10px" type="warning">添加联系人</el-button>
                                    </div>
                                    <template v-if="add_cusName_list2.length > 0">
                                        <el-form-item v-for="(item, index) in add_cusName_index2" :key="index" label="联系人：">
                                            <!-- @click="choseMapPoint" -->
                                            <div style="display: flex;">
                                                <div style="display: flex;">
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].name"
                                                        placeholder="请输入联系人姓名" />
                                                    <el-input style="width:220px" v-model="add_cusName_list2[index].mobile"
                                                        placeholder="请输入联系人电话" />
                                                </div>

                                                <div style="margin-left: 40px;">
                                                    <el-button @click="add_cusName_index_delbtn2(index)" type="danger"
                                                        icon="Close" plain size="mini" title="联系人">
                                                        联系人
                                                    </el-button>
                                                </div>
                                            </div>
                                        </el-form-item>
                                    </template>
                                </el-form>
                                <el-collapse>
                                    <el-collapse-item title="显示更多选填信息" name="1">

                                        <el-form-item label="备注" :required="false">
                                            <el-input show-word-limit maxlength="200" :rows="4" type="textarea"
                                                placeholder="请输入备注" v-model="add_data.returnOrder.remark" />
                                        </el-form-item>
                                    </el-collapse-item>

                                </el-collapse>
                            </div>
                        </div>

                    </div>
                </div>


            </div>

        </el-dialog>
        <!-- 地图弹窗 -->
        <el-dialog style="margin-top:10vh;height:80vh;overflow: hidden;" v-model="map_off" title="选择地址:" width="80%"
            :close-on-click-modal='false'>
            <div class="div_map">
                <div class="map_input">
                    <el-input @input="map_change" id='tipinput' style="width:40%" v-model="map_address" placeholder="请输入地址">
                        <template #prepend>选择地址:</template>
                    </el-input>
                    <el-button @click="map_ok_btn" type="primary">确认</el-button>
                </div>
                <div v-if="map_address_list.length > 0" class="map_input2">
                    <div style="width:40%;background:#fff;margin-left:20px;padding: 10px;font-weight: 700;">
                        <div @click="map_list_btn(item)" class="div_bg" v-for="(item, index) in map_address_list"
                            :key="index" style="margin-top: 10px;">
                            {{ item.area }}-{{ item.name }}
                        </div>
                    </div>
                </div>
                <div id="myMap" style="height: 65vh; width: 100%">
                </div>
            </div>
        </el-dialog>

        <!-- 航班选择 -->
        <el-dialog style="margin-top:5vh" v-model="land_se_off" title="航班自动查询" width="40%" :close-on-click-modal='false'>
            <div>
                <div style="color:red">
                    航班自动查询：【接天府】航班降落时间系统会默认延后30分钟
                </div>
                <div style="color:red;margin-top:10px">
                    航班自动查询：【送天府】航班起飞时间系统会默认提前4小时
                </div>
                <div style="margin-top:20px">
                    <el-form :model="land_se" label-width="110px" label-suffix="：">

                        <el-form-item label="航班号" :required="false">
                            <el-input style=" width: 200px" v-model="land_se.num" placeholder="请输入航班号" />
                        </el-form-item>
                        <el-form-item label="航班日期" :required="false">
                            <el-date-picker style=" width: 200px" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
                                v-model="land_se.date" type="date" placeholder="请选择航班日期" />
                        </el-form-item>
                        <el-button @click="ok_land_se_btn" style="margin-left:30vw;margin-top:5px"
                            type="primary">确认查询</el-button>
                        <hr>
                        <div v-if="land_se_list.depPort" style="width: 80%;display:flex;;border-radius: 8px;background: antiquewhite;margin: auto;height: 80px;
                        justify-content: space-evenly; " @click="land_se_list_btn(1)">
                            <div style="display: flex;flex-direction: column;justify-content: space-evenly;">
                                <div style="font-weight:700">{{ land_se_list.depScheduled.split(' ')[1] }}</div>
                                <div>{{ land_se_list.depPort }}T{{ land_se_list.depTerminal }}</div>
                                <div style="color:#666;font-weight:700"> {{ land_se_list.flightNo }}</div>
                            </div>
                            <div style="display:flex;align-items: center;">
                                <el-icon :size="60">
                                    <DArrowRight />
                                </el-icon>
                            </div>
                            <div style="display: flex;flex-direction: column;justify-content: space-evenly;">
                                <div style="font-weight:700"> {{ land_se_list.arrScheduled.split(' ')[1] }}</div>
                                <div> {{ land_se_list.arrPort }}T{{ land_se_list.arrTerminal }}</div>
                                <div style="color:#666;font-weight:700"> {{ land_se_list.depScheduled.split(' ')[0] }}</div>
                            </div>
                        </div>
                    </el-form>
                </div>
            </div>


        </el-dialog>

        <!-- 订单合并-->
        <el-dialog style="margin-top:5vh" v-model="mer_off" title="合并订单" width="80%" :close-on-click-modal='false'>
            <div>

                <el-table border @selection-change="table_list_selection_change_btn" height="60vh" ref="multipleTableRef"
                    :data="mer_list" style="width: 100%">
                    <el-table-column type="selection" width="35" />
                    <el-table-column label="编号" width="55" fixed type="index" />
                    <el-table-column width="120" property="orderNum" label="订单号" />
                    <el-table-column width="120" property="routeSimpleName" label="行程简称" />
                    <el-table-column width="100" label="订单状态">
                        <template #="{ row, column, $index }">
                            {{ row.status == 'READY_CAR' ? '未派车' : row.status == 'CAR_READY_CONFIRME' ? '待确认' : row.status
                                ==
                                'DRIVER_READY_RECEIVE' ? '待接单' : row.status == 'READY_ROAD' ? '未出行' : row.status == 'ON_ROADING'
                                    ? '未完团' : row.status == 'FINISHED' ? '完成' : '' }}

                        </template>
                    </el-table-column>
                    <el-table-column width="120" property="personNum" label="人数" />
                    <el-table-column width="120" property="flightNum" label="航班号" />
                    <el-table-column width="120" label="出发日期">
                        <template #="{ row, column, $index }">
                            <span>{{ row.startTime.split(' ')[0] }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column width="100" label="出发时间">
                        <template #="{ row, column, $index }">
                            <span>{{ row.startTime.split(' ')[1] }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column width="120" property="waitDate" label="可等待时间" />
                    <el-table-column width="220" property="fromLocation" label="起点" />
                    <el-table-column width="220" property="toLocation" label="终点" />
                    <el-table-column width="160" label="乘车人">
                        <template #="{ row, column, $index }">
                            <span>{{ row.cusName }}-{{ row.cusMobile }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column width="100" label="推广人">
                        <template #="{ row, column, $index }">
                            <span v-if="row.shareName">{{ row.shareName }}-{{ row.shareMobile }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column width="100" property="price" label="订单价格" />
                    <el-table-column width="220" property="remark" label="客户备注" />
                    <el-table-column width="120" property="useCarCompanyId" label="用车单位" />
                    <el-table-column width="120" property="useCarName" label="用车负责人 " />
                    <el-table-column width="170" property="addTime" label="添加时间" />
                    <el-table-column width="120" property="isMerge" label="合并标识" />
                    <el-table-column width="100" label="合并标识">
                        <template #="{ row, column, $index }">
                            <span>{{ row.isMerge == true ? '合并' : '未合并' }}</span>
                        </template>
                    </el-table-column>
                </el-table>
                <el-button style="margin-left:67vw;margin-top:20px;" @click="mer_add_ok_btn" type="primary">确认合并</el-button>
            </div>


        </el-dialog>
    </div>
</template>

<script setup>
import Sortable from 'sortablejs';
import { GET_TOKEN } from '@/utils/token.js'
import { ref, reactive, onMounted, computed, watch } from 'vue'
import {
    getOrderList, findTravelWayInfo, getStationListPages, add, findStationCombo, getStationType, findAddressByLocation, findMapPointList,
    edit, omsorderdelete, getOrderInfo, mergeQuery, merge, omsorderexport, cancelMerge, adupPrivateSet, getPrivateSetList, getPrice
} from '@/api/original_order_list.js'
import { ElMessage, ElLoading, ElMessageBox } from 'element-plus'
import AMapLoader from "@amap/amap-jsapi-loader"
import { securityJsCode, key, importCusCheckInData } from '@/utils/common.js'
import * as XLSX from 'xlsx';
import CircularJSON from 'circular-json'
onMounted(async () => {
    let original_order_list = JSON.parse(localStorage.getItem('original_order_list'))
    if (original_order_list) {
        find_data.routeSimpleName = original_order_list.routeSimpleName
        find_data.useCarCompanyId = original_order_list.useCarCompanyId
        find_data.personNum = original_order_list.personNum
        find_data.startTime = original_order_list.startTime
        find_data.find = original_order_list.find
        find_data.shareMobile = original_order_list.shareMobile
        find_data.isMerge = original_order_list.isMerge

    }

    getPrivateSetList({
        find: '订单列表',
        page: {
            pageNum: 1,
            pageSize: 20,
        },
    }).then(res => {
        if (res.data.list[0]) {
            table_data_list_new.value = JSON.parse(res.data.list[res.data.list.length - 1].dat)
        } else {

            table_data_list_new.value = table_data_list
        }
    })
    Sortable.create(sortableContainer.value, {
        draggable: '.drag_it',
        ghostClass: 'sortable-ghost',
        onEnd: evt => {
            const targetRow = table_data_list_new.value.splice(evt.oldIndex, 1)[0];
            table_data_list_new.value.splice(evt.newIndex, 0, targetRow);

            // 重新赋值给列数组
            // let cols = that.U.scopy(that.fields);
            // let list = cols.filter(it => { return it.show; });
            // that.$emit('saveSet', {dgName: that.dgName, cols: list});
        }
    })
    findStationCombo({
        page: {
            pageNum: 1,
            pageSize: 999,
        },
        stationTypes: ['AIRPORT']
    }).then(res => {
        aircraft_list.value = res.data.list
    })
    findStationCombo({
        page: {
            pageNum: 1,
            pageSize: 999,
        },
        stationTypes: ['TRAIN']
    }).then(res => {
        train_list.value = res.data.list
    })
    findStationCombo({
        page: {
            pageNum: 1,
            pageSize: 999,
        },
        stationTypes: ['BUS']
    }).then(res => {
        bus_list.value = res.data.list
    })
    // getStationType({}).then(res => {

    // })
    await getStationList()
    await list_api()
})

// 添加联系人
const add_cusName_list = ref([])
const add_cusName_index = ref(0)
const add_cusName_off = ref('')
const add_cusName_list2 = ref([])
const add_cusName_index2 = ref(0)

const add_cusName_index_delbtn = (index) => {
    add_cusName_index.value -= 1
    add_cusName_list.value.splice(index, 1)
    // $forceUpdate()
}
const add_cusName_index_delbtn2 = (index) => {
    add_cusName_index2.value -= 1
    add_cusName_list2.value.splice(index, 1)
    // $forceUpdate()
}
const add_cusName_btn = (e) => {
    let p = {
        name: '',
        mobile: '',
    }
    if (e == 1) {
        add_cusName_list.value.push(p)
        add_cusName_index.value += 1
    } else if (e == 2) {
        add_cusName_list2.value.push(p)
        add_cusName_index2.value += 1
    }

}

// 自动计算价格
const price_btn = (e) => {
    return alert('自动计算价格')
    if (e == 1) {
        getPrice({
            page: {
                pageNum: 1,
                pageSize: 999,
            },
            stationTypes: ['BUS']
        }).then(res => {
            bus_list.value = res.data.list
        })
    }
}

//#region 新添加订单
const cat_map = ref('0')
const car_map_btn = (e) => {
    console.log(2)
    // 地图
    window._AMapSecurityConfig = {
        securityJsCode: securityJsCode,
    }
    // 首次加载
    AMapLoader.load({
        key: key,
        version: '2.0',
        plugins: ['AMap.Driving', 'AMap.Geolocation', 'AMap.Scale', 'AMap.AutoComplete', 'AMap.PlaceSearch'],
    }).then((AMap) => {
        // 初始化-地图对象
        myMap.value = new AMap.Map('myMap', { zoom: 10, center: [104.065861, 30.657401] });




    }).catch(err => { console.log('高德地图加载失败：', err); });
    cat_map.value = 1

    isReturn_map_off.value = e


    map_address.value = ''
    map_value.value = ''
    map_address_list.value = ''
    map_off.value = true
}
const activeName_tabs1 = ref('aircraft')
const handleClick_tabs1 = (tab, event) => {
    console.log(tab, event)
    console.log(tab.props.name)
    if (tab.props.name == 'aircraft') {
        activeName_tabs2.value = 'aircraft_connect'
    } else if (tab.props.name == 'train') {
        activeName_tabs2.value = 'aircraft_connect'
    } else if (tab.props.name == 'bus') {
        activeName_tabs2.value = 'aircraft_connect'
    }
}

const activeName_tabs2 = ref('aircraft_connect')
const handleClick_tabs2 = (tab, event) => {
    console.log(tab, event)
    // console.log(activeName_tabs2.value)
    // if (tab.props.name == 'aircraft') {
    //     activeName_tabs2.value = 'aircraft_connect'
    // } else if (tab.props.name == 'train') {
    //     activeName_tabs2.value = 'train_connect'
    // } else if (tab.props.name == 'bus') {
    //     activeName_tabs2.value = 'bus_connect'
    // }
}

const aircraft_name = ref('飞机')
const train_name = ref('火车')
const bus_name = ref('大巴')
const aircraft_radio = ref('包车')
const aircraft_radio2 = ref('包车')
const aircraft_list = ref([])
const train_list = ref([])
const bus_list = ref([])
// 添加途径点
const passing_points_list = ref([])
const passing_points_index = ref(0)
const passing_points_off = ref('')
const passing_points_list2 = ref([])
const passing_points_index2 = ref(0)
const add_passing_points = (e) => {
    // 地图
    window._AMapSecurityConfig = {
        securityJsCode: securityJsCode,
    }
    // 首次加载
    AMapLoader.load({
        key: key,
        version: '2.0',
        plugins: ['AMap.Driving', 'AMap.Geolocation', 'AMap.Scale', 'AMap.AutoComplete', 'AMap.PlaceSearch'],
    }).then((AMap) => {
        // 初始化-地图对象
        myMap.value = new AMap.Map('myMap', { zoom: 10, center: [104.065861, 30.657401] });




    }).catch(err => { console.log('高德地图加载失败：', err); });
    passing_points_off.value = e
    map_address.value = ''
    map_value.value = ''
    map_address_list.value = ''
    map_off.value = true
}
const passing_points_index_delbtn = (index) => {
    passing_points_index.value -= 1
    passing_points_list.value.splice(index, 1)
    // $forceUpdate()
}
const passing_points_index_delbtn2 = (index) => {
    passing_points_index2.value -= 1
    passing_points_list2.value.splice(index, 1)
    // $forceUpdate()
}
//#region 接机
const chartered_bus_off = ref(false) // 包车拼车开关
const chartered_bus_off2 = ref(false)
const aircraft_connect_change = (e) => {
    if (e.includes('天府')) {
        chartered_bus_off.value = true
    } else {
        chartered_bus_off.value = false
    }

}
const aircraft_connect_change2 = (e) => {
    if (e.includes('天府')) {
        chartered_bus_off2.value = true
    } else {
        chartered_bus_off2.value = false
    }
}
//#endregion
//#endregion


//#region 表格数据处理
const table_data_list = reactive([
    { label: '订单号', field: 'orderNum', width: 120, off: true },
    { label: '行程简称', field: 'routeSimpleName', width: 120, off: true },
    { label: '订单状态', field: 'status', width: 100, off: true },
    { label: '人数', field: 'personNum', width: 120, off: true },
    { label: '航班号', field: 'flightNum', width: 120, off: true },
    { label: '出发日期', field: 'startDate', width: 120, off: true },
    { label: '出发时间', field: 'startTime', width: 100, off: true },
    { label: '可等待时间', field: 'waitDate', width: 120, off: true },
    { label: '起点', field: 'fromLocation', width: 220, off: true },
    { label: '终点', field: 'toLocation', width: 220, off: true },
    { label: '乘车人', field: 'cusName', width: 160, off: true },
    { label: '推广人', field: 'shareName', width: 160, off: true },
    { label: '订单价格', field: 'price', width: 100, off: true },
    { label: '客户备注', field: 'remark', width: 220, off: true },
    { label: '用车单位', field: 'useCarCompanyId', width: 120, off: true },
    { label: '用车负责人', field: 'useCarName', width: 120, off: true },
    { label: '添加时间', field: 'addTime', width: 170, off: true },
    { label: '合并标识', field: 'isMerge', width: 100, off: true },
])

const table_data_list_new = ref([])
const icon_off = ref(false)
// 创建排序容器的引用
const sortableContainer = ref('')

const icon_btn = () => {
    icon_off.value = !icon_off.value
    console.log(sortableContainer.value)

}
const resetTableSet = () => {
    table_data_list_new.value = JSON.parse(JSON.stringify(table_data_list))

}
const saveTableSet = () => {

    adupPrivateSet({
        dat: JSON.stringify(table_data_list_new.value),
        tbName: '订单列表',
        tbNum: "original_order_list",
    }).then(res => {
        if (res.code == 1) {
            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }
    })
    icon_off.value = false
}

const checkbox_btn = (e, c) => {
    for (let i = 0; i < table_data_list_new.value.length; i++) {
        if (table_data_list_new.value[i].label == c.target._value) {
            table_data_list_new.value[i].off == e

        }

    }

}

const sortedItems = computed(() => {
    return [...table_data_list_new.value].sort((a, b) => a.id - b.id);
})
//#endregion



//#region 订单合并
const mer_off = ref(false)
const mer_list = ref([])
//订单合并表格选择
const table_list_table_list = ref([])
const table_list_selection_change_btn = (e) => {
    table_list_table_list.value = e
    console.log(table_list_table_list.value)
}

const mer_btn = () => {
    if (table_list.value.length != 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    }
    //87  table_list.value[0].id
    mergeQuery({ id: table_list.value[0].id }).then(res => {
        if (res.code == 1) {
            mer_list.value = res.data
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }
    })

    mer_off.value = true
}
const mer_add_ok_btn = () => {
    if (table_list_table_list.value.length > 2 || table_list_table_list.value.length < 1) {

        return ElMessage({
            message: '请选择一条或两条数据进行合并！',
            type: 'warning',
        })
    }
    let ps = [table_list.value[0].id]
    for (let i = 0; i < table_list_table_list.value.length; i++) {
        ps.push(table_list_table_list.value[i].id)
    }
    merge({ ids: ps }).then(res => {
        if (res.code == 1) {
            list_api()
            mer_off.value = false
            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }
    })
}
//#endregion
//#region 取消合并
const nomer_btn = () => {
    if (table_list.value.length != 1) {

        return ElMessage({
            message: '请选择一条数据取消合并！',
            type: 'warning',
        })
    }
    // 115  table_list.value[0].id
    cancelMerge({ id: table_list.value[0].id }).then(res => {
        if (res.code == 1) {
            list_api()
            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }
    })
}
//#endregion
// 是否返程
const isReturn_map_off = ref('')
const isReturn_list = reactive([
    {
        value: 'true',
        label: '是',
    },
    {
        value: 'false',
        label: '否',
    },
])

// 行程简称
const routeSimpleName_list = reactive([
    {
        value: '送天府',
        label: '送天府',
    },
    {
        value: '接天府',
        label: '接天府',
    },
    {
        value: '拼车送天府',
        label: '拼车送天府',
    },
    {
        value: '拼车接天府',
        label: '拼车接天府',
    },
    {
        value: '送双流',
        label: '送双流',
    },
    {
        value: '接双流',
        label: '接双流',
    },
    {
        value: '送东站',
        label: '送东站',
    },
    {
        value: '接东站',
        label: '接东站',
    },
    {
        value: '送西站',
        label: '送西站',
    },
    {
        value: '接西站',
        label: '接西站',
    },
    {
        value: '送南站',
        label: '送南站',
    },
    {
        value: '接南站',
        label: '接南站',
    }, {
        value: '送集合点大巴',
        label: '送集合点大巴',
    },
    {
        value: '接集合点大巴',
        label: '接集合点大巴',
    },
])

//#region 航班查询
const land_se_off = ref(false)
const land_se = reactive({
    date: '',
    num: '',
    travelWay: '1'
})
const land_se_btn_num = ref('1')
const land_se_btn = (e) => {
    if (e == 2) {
        land_se.date = ''
        land_se.num = ''
        land_se_list.value = {}
        land_se_btn_num.value = '2'
        land_se_off.value = true
    } else {
        land_se.date = ''
        land_se.num = ''
        land_se_list.value = {}
        land_se_btn_num.value = '1'
        land_se_off.value = true
    }
}
const land_se_list = ref({})

const ok_land_se_btn = () => {
    if (!land_se.date) {
        return ElMessage({
            message: '请输入航班时间',
            type: 'warning',
        })
    } else if (!land_se.num) {
        return ElMessage({
            message: '请输入航班号',
            type: 'warning',
        })
    }

    findTravelWayInfo(land_se).then(res => {
        if (res.code == 1) {
            res.data.data.list[0].arrScheduled = land_se.date + ' ' + res.data.data.list[0].arrScheduled.split(' ')[1]
            res.data.data.list[0].depScheduled = land_se.date + ' ' + res.data.data.list[0].depScheduled.split(' ')[1]
            land_se_list.value = res.data.data.list[0]

            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }
    })
}


const land_se_list_btn = (e) => {
    if (land_se_btn_num.value == '2') {


        if (activeName_tabs2.value == 'aircraft_connect') {
            if (land_se_list.value.arrPort.includes('天府')) {
                add_data.returnOrder.flightNum = land_se_list.value.flightNo
                add_data.returnOrder.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.returnOrder.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.returnOrder.toLocation = '简阳天府机场T' + land_se_list.value.depTerminal

            } else if (add_data.fromLocation.includes('双流')) {
                add_data.returnOrder.flightNum = land_se_list.value.flightNo
                add_data.returnOrder.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.returnOrder.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.returnOrder.toLocation = '成都双流机场T' + land_se_list.value.arrTerminal
            } else {
                return ElMessage({
                    message: '抱歉暂时只支持成都天府和双流机场业务！',
                    type: 'warning',
                })
            }
        } else if (activeName_tabs2.value == 'aircraft_deliver') {
            if (land_se_list.value.arrPort.includes('天府')) {
                add_data.flightNum = land_se_list.value.flightNo
                add_data.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.returnOrder.fromLocation = '简阳天府机场T' + land_se_list.value.arrTerminal

            } else if (add_data.fromLocation.includes('双流')) {
                add_data.flightNum = land_se_list.value.flightNo
                add_data.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.returnOrder.fromLocation = '成都双流机场T' + land_se_list.value.arrTerminal
            } else {
                return ElMessage({
                    message: '抱歉暂时只支持成都天府和双流机场业务！',
                    type: 'warning',
                })
            }
        }
    } else {
        if (activeName_tabs2.value == 'aircraft_connect') {
            if (land_se_list.value.arrPort.includes('天府')) {
                add_data.flightNum = land_se_list.value.flightNo
                add_data.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.fromLocation = '简阳天府机场T' + land_se_list.value.arrTerminal

            } else if (add_data.fromLocation.includes('双流')) {
                add_data.flightNum = land_se_list.value.flightNo
                add_data.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.fromLocation = '成都双流机场T' + land_se_list.value.arrTerminal
            } else {
                return ElMessage({
                    message: '抱歉暂时只支持成都天府和双流机场业务！',
                    type: 'warning',
                })
            }
        } else if (activeName_tabs2.value == 'aircraft_deliver') {
            if (land_se_list.value.arrPort.includes('天府')) {
                add_data.flightNum = land_se_list.value.flightNo
                add_data.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.toLocation = '简阳天府机场T' + land_se_list.value.arrTerminal

            } else if (add_data.fromLocation.includes('双流')) {
                add_data.flightNum = land_se_list.value.flightNo
                add_data.flightDate = add4hours(land_se_list.value.arrScheduled)
                add_data.landDate = add30Minutes(land_se_list.value.arrScheduled)
                add_data.toLocation = '成都双流机场T' + land_se_list.value.arrTerminal
            } else {
                return ElMessage({
                    message: '抱歉暂时只支持成都天府和双流机场业务！',
                    type: 'warning',
                })
            }
        }



    }


    land_se_off.value = false
}

//#endregion

//#region 酒店查询
const getStationList_Data = ref([])
const getStationList = () => {

    getStationListPages({
        page: {
            pageNum: 1,
            pageSize: 999,
        },
        stationTypes: ['HOTEL'],
    }).then(res => {
        if (res.code == 1) {
            getStationList_Data.value = res.data.list
        }
    })
}
const select_Btn = (e) => {
    if (activeName_tabs2.value == 'aircraft_connect') {
        let list = {}
        for (let i = 0; i < getStationList_Data.value.length; i++) {
            if (e == getStationList_Data.value[i].stationName) {
                list = getStationList_Data.value[i]
            }

        }
        add_data.toLocation = list.stationName
        add_data.toLocationData.address = list.address
        add_data.toLocationData.id = list.id
        add_data.toLocationData.lnglat = list.lngLat
        add_data.toLocationData.tel = list.hotelLinkPhone
        console.log(add_data.toLocationData.id)
    } else {
        let list = {}
        for (let i = 0; i < getStationList_Data.value.length; i++) {
            if (e == getStationList_Data.value[i].stationName) {
                list = getStationList_Data.value[i]
            }

        }
        add_data.fromLocation = list.stationName
        add_data.fromLocationData.address = list.address
        add_data.fromLocationData.id = list.id
        add_data.fromLocationData.lnglat = list.lngLat
        add_data.fromLocationData.tel = list.hotelLinkPhone

    }

}
const select_Btn2 = (e) => {
    if (activeName_tabs2.value == 'aircraft_connect') {
        let list = {}
        for (let i = 0; i < getStationList_Data.value.length; i++) {
            if (e == getStationList_Data.value[i].stationName) {
                list = getStationList_Data.value[i]
            }

        }
        // add_data.fromLocation = list.stationName
        add_data.returnOrder.fromLocationData.address = list.address
        add_data.returnOrder.fromLocationData.id = list.id
        add_data.returnOrder.fromLocationData.lnglat = list.lngLat
        add_data.returnOrder.fromLocationData.tel = list.hotelLinkPhone

    } else {
        let list = {}
        for (let i = 0; i < getStationList_Data.value.length; i++) {
            if (e == getStationList_Data.value[i].stationName) {
                list = getStationList_Data.value[i]
            }

        }

        // add_data.toLocation = list.stationName
        add_data.returnOrder.toLocationData.address = list.address
        add_data.returnOrder.toLocationData.id = list.id
        add_data.returnOrder.toLocationData.lnglat = list.lngLat
        add_data.returnOrder.toLocationData.tel = list.hotelLinkPhone
        console.log(add_data.toLocationData.id)
    }

}

// 

const toLocation_querySearch = (queryString, cb) => {
    let results = []
    getStationListPages({
        page: {
            pageNum: 1,
            pageSize: 5,
        },
        find: queryString,
    }).then(res => {
        if (res.code == 1) {
            res.data.list.forEach(it => {
                results.push({
                    id: it.id,
                    // 坐标
                    lnglat: it.lngLat,
                    // 名称
                    stationName: it.stationName,
                    // 地址
                    address: it.address,
                    // 电话
                    tel: it.hotelLinkPhone,
                    value: it.stationName

                });
            });
        }
        cb(results)
    })
}
const toLocation_handleSelect = (item) => {
    if (activeName_tabs2.value == 'aircraft_connect') {
        add_data.toLocation = item.stationName
        add_data.toLocationData.address = item.address
        add_data.toLocationData.id = item.id
        add_data.toLocationData.lnglat = item.lngLat
        add_data.toLocationData.tel = item.hotelLinkPhone
    } else {
        add_data.fromLocation = item.stationName
        add_data.fromLocationData.address = item.address
        add_data.fromLocationData.id = item.id
        add_data.fromLocationData.lnglat = item.lngLat
        add_data.fromLocationData.tel = item.hotelLinkPhone
    }

}
//#endregion

//#region 地图
const myMap = ref('')
const geolocation = ref('') // 定位
const map_address = ref('')
const map_address_list = ref([])
const map_value = ref({})
const marker = ref('')
const map_off = ref(false)
const map_off_btn = (e) => {
    if (e == 2) {
        isReturn_map_off.value = e
    }
    // 地图
    window._AMapSecurityConfig = {
        securityJsCode: securityJsCode,
    }
    // 首次加载
    AMapLoader.load({
        key: key,
        version: '2.0',
        plugins: ['AMap.Driving', 'AMap.Geolocation', 'AMap.Scale', 'AMap.AutoComplete', 'AMap.PlaceSearch'],
    }).then((AMap) => {
        // 初始化-地图对象
        myMap.value = new AMap.Map('myMap', { zoom: 10, center: [104.065861, 30.657401] });




    }).catch(err => { console.log('高德地图加载失败：', err); });

    map_off.value = true
}
const map_change = () => {
    // let autoOptions = {
    //     city: '成都市'
    // }
    // var autoComplete = new AMap.Autocomplete(autoOptions);
    // autoComplete.search(map_address.value, function (status, result) {
    //     // 搜索成功时，result即是对应的匹配数据
    //     map_address_list.value = result.tips.slice(0, 5)
    // })

    findMapPointList({
        city: '',
        isFindSta: '0',
        keywords: map_address.value,

    }).then(res => {
        map_address_list.value = res.data.slice(0, 5)
    })
}




const map_list_btn = (e) => {
    console.log(e)
    map_address.value = e.area + '-' + e.name
    map_value.value = e
    let lnglat = [e.lnglat.split(',')[0], e.lnglat.split(',')[1]]
    myMap.value.panTo(lnglat);
    if (marker.value) {
        myMap.value.remove(marker.value);
    }
    myMap.value.setFitView();
    marker.value = new AMap.Marker({
        map: myMap.value,
        position: lnglat,
    });
    myMap.value.setFitView();
    myMap.value.add(marker.value);
    // findAddressByLocation({
    //     city: '',
    //     isFindSta: '0',
    //     keywords: '',
    //     location: e.location.lng + ',' + e.location.lat
    // }).then(res => {

    // })
    // findMapPointList({
    //     city: '',
    //     isFindSta: '0',
    //     keywords: e.name,

    // }).then(res => {

    // })
}
const map_ok_btn = () => {
    if (passing_points_off.value == '1') {
        let p = {
            address: map_value.value.address,
            area: map_value.value.area,
            id: map_value.value.id,
            isSta: map_value.value.isSta,
            lnglat: map_value.value.lnglat,
            name: map_value.value.name,
            tel: map_value.value.tel,
        }
        passing_points_list.value.push(p)
        passing_points_index.value += 1
        // $forceUpdate()

    } else if (passing_points_off.value == '2') {
        let p = {
            address: map_value.value.address,
            area: map_value.value.area,
            id: map_value.value.id,
            isSta: map_value.value.isSta,
            lnglat: map_value.value.lnglat,
            name: map_value.value.name,
            tel: map_value.value.tel,
        }
        passing_points_list2.value.push(p)
        passing_points_index2.value += 1
    } else if (cat_map.value == '1') {
        console.log(101, isReturn_map_off.value)
        if (isReturn_map_off.value == 2) {
            console.log(101, isReturn_map_off.value)
            if (activeName_tabs2.value == 'aircraft_connect') {
                add_data.returnOrder.toLocation = map_value.value.name
                add_data.returnOrder.toLocationData.address = map_value.value.address
                add_data.returnOrder.toLocationData.id = map_value.value.id
                add_data.returnOrder.toLocationData.lnglat = map_value.value.lnglat
                add_data.returnOrder.toLocationData.tel = map_value.value.tel

            } else {
                add_data.returnOrder.fromLocation = map_value.value.name
                add_data.returnOrder.fromLocationData.address = map_value.value.address
                add_data.returnOrder.fromLocationData.id = map_value.value.id
                add_data.returnOrder.fromLocationData.lnglat = map_value.value.lnglat
                add_data.returnOrder.fromLocationData.tel = map_value.value.tel

            }

        } else {
            if (activeName_tabs2.value == 'aircraft_connect') {
                add_data.fromLocation = map_value.value.name
                add_data.fromLocationData.address = map_value.value.address
                add_data.fromLocationData.id = map_value.value.id
                add_data.fromLocationData.lnglat = map_value.value.lnglat
                add_data.fromLocationData.tel = map_value.value.tel
                add_data.fromLocationData.isSta = map_value.value.isSta
                add_data.fromLocationData.area = map_value.value.area




            } else {
                add_data.toLocation = map_value.value.name

                add_data.toLocationData.address = map_value.value.address
                add_data.toLocationData.id = map_value.value.id
                add_data.toLocationData.lnglat = map_value.value.lnglat
                add_data.toLocationData.tel = map_value.value.tel
                add_data.toLocationData.isSta = map_value.value.isSta
                add_data.toLocationData.area = map_value.value.area
            }
        }
    } else {
        if (isReturn_map_off.value == 2) {
            if (activeName_tabs2.value == 'aircraft_connect') {
                add_data.returnOrder.fromLocation = map_value.value.name
                add_data.returnOrder.fromLocationData.address = map_value.value.address
                add_data.returnOrder.fromLocationData.id = map_value.value.id
                add_data.returnOrder.fromLocationData.lnglat = map_value.value.lnglat
                add_data.returnOrder.fromLocationData.tel = map_value.value.tel

            } else {
                add_data.returnOrder.toLocation = map_value.value.name
                add_data.returnOrder.toLocationData.address = map_value.value.address
                add_data.returnOrder.toLocationData.id = map_value.value.id
                add_data.returnOrder.toLocationData.lnglat = map_value.value.lnglat
                add_data.returnOrder.toLocationData.tel = map_value.value.tel

            }
        } else {
            if (activeName_tabs2.value == 'aircraft_connect') {
                add_data.toLocation = map_value.value.name
                add_data.toLocationData.address = map_value.value.address
                add_data.toLocationData.id = map_value.value.id
                add_data.toLocationData.lnglat = map_value.value.lnglat
                add_data.toLocationData.tel = map_value.value.tel
                add_data.toLocationData.isSta = map_value.value.isSta
                add_data.toLocationData.area = map_value.value.area



            } else {
                add_data.fromLocation = map_value.value.name

                add_data.fromLocationData.address = map_value.value.address
                add_data.fromLocationData.id = map_value.value.id
                add_data.fromLocationData.lnglat = map_value.value.lnglat
                add_data.fromLocationData.tel = map_value.value.tel
                add_data.fromLocationData.isSta = map_value.value.isSta
                add_data.fromLocationData.area = map_value.value.area
            }
        }
    }

    cat_map.value = '0'
    passing_points_off.value = false
    isReturn_map_off.value = ''
    console.log(isReturn_map_off.value)
    map_off.value = false

}
//#endregion

// 合并标识
const isMerge_list = reactive([
    {
        value: 'true',
        label: '合并',
    },
    {
        value: 'false',
        label: '未合并',
    },
])

//#region 分页列表
const list_data = ref([])
const find_data = reactive({
    page: {
        pageNum: 1,
        pageSize: 20,
    },
    routeSimpleName: '',
    useCarCompanyId: '',
    personNum: '',
    startTime: '',
    find: '',
    shareMobile: '',
    isMerge: '',
})
const total = ref(0)

// 分页器一夜显示多少数据页面
const size_change_btn = () => {
    find_data.page.pageNum = 1
    list_api()
}

// 分页器跳转页面
const current_change_btn = () => {
    list_api()
}

const list_api = () => {

    getOrderList(find_data).then(res => {
        list_data.value = res.data.list
        total.value = res.data.total
    })
}
//#endregion

//#region 添加 
const add_off = ref(false)
const title = ref('添加订单')
const add_data = reactive({
    cusMobile: '', // 乘车人电话
    cusName: '', // 乘车人
    flightDate: '',// 航班起飞时间 yyyy-MM-dd HH:mm
    flightNum: "",// 航班号
    fromLocation: "",// 出发地名称
    fromLocationData: {
        address: '',
        area: '',
        id: "",
        isSta: "",
        lnglat: "",
        name: "",
        tel: "",
        type: ""
    },// 出发地
    fromLocationId: '',// 出发地主数据id(接天府肯定有)
    landDate: '',// 航班降落时间 yyyy-MM-dd HH:mm
    personNum: '',// 预约人数
    receiveMsg: '',// true通知,false不通知
    remark: '',// 备注
    routeSimpleName: '拼车送天府',// 行程简称,拼车接天府/拼送天府
    toLocation: '',// 目的地名称
    toLocationData: {
        address: '',
        area: '',
        id: "",
        isSta: "",
        lnglat: "",
        name: "",
        tel: "",
        type: ""
    },// 目的地
    toLocationId: '',// 目的地主数据id(送天府肯定有)
    userId: '',// 用户Id,对应Customers表数据的id
    id: '',
    isReturnAdd: "false",// 是否返程,true,false
    returnTime: '',// 返程时间,yyyy-MM-dd HH:mm:ss
    returnOrder: {
        fromLocation: "",// 出发地名称
        toLocation: '',// 目的地名称
        personNum: "",
        cusName: '',
        cusMobile: '',
        flightDate: '',// 航班起飞时间 yyyy-MM-dd HH:mm
        landDate: "", //航班降落时间 yyyy-MM-dd HH:mm
        fromLocationId: "",// 出发地主数据id(接天府肯定有)
        toLocationId: '',// 目的地主数据id(送天府肯定有)
        fromLocationData: {
            address: '',
            area: '',
            id: "",
            isSta: "",
            lnglat: "",
            name: "",
            tel: "",
            type: ""
        },// 出发地
        toLocationData: {
            address: '',
            area: '',
            id: "",
            isSta: "",
            lnglat: "",
            name: "",
            tel: "",
            type: ""
        },// 目的地
        routeSimpleName: '',
        needSeats: '',
        flightTime: '',
        days: '',
        isHighSpeed: '',
        type: '',
        price: '',
        points: [],
        persons: [],
    },
    needSeats: '',
    flightTime: '',
    days: '',
    isHighSpeed: '',
    type: '',
    price: '',
    points: [],
    persons: [],
})

const handleClick = (tab, event) => {
    add_data.routeSimpleName = tab.paneName
    console.log(add_data.routeSimpleName)
}

const add_btn = () => {

    title.value = '添加订单'
    add_data.cusMobile = ''
    add_data.cusName = ''
    add_data.flightDate = ''
    add_data.flightNum = ''
    add_data.fromLocation = ''
    add_data.fromLocationData.address = ''
    add_data.fromLocationData.area = ''
    add_data.fromLocationData.id = ''
    add_data.fromLocationData.isSta = ''
    add_data.fromLocationData.lnglat = ''
    add_data.fromLocationData.name = ''
    add_data.fromLocationData.tel = ''
    add_data.fromLocationData.type = ''
    add_data.fromLocationId = ''
    add_data.isReturnAdd = 'false'
    add_data.landDate = ''
    add_data.personNum = ''
    add_data.receiveMsg = ''
    add_data.remark = ''
    add_data.returnTime = ''
    add_data.routeSimpleName = ''
    add_data.toLocation = ''
    add_data.toLocationData.address = ''
    add_data.toLocationData.area = ''
    add_data.toLocationData.id = ''
    add_data.toLocationData.isSta = ''
    add_data.toLocationData.lnglat = ''
    add_data.toLocationData.name = ''
    add_data.toLocationData.tel = ''
    add_data.toLocationData.type = ''
    add_data.toLocationId = ''
    add_data.userId = ''
    add_data.id = ''
    add_data.needSeats = ''
    add_data.flightTime = ''
    add_data.days = ''
    add_data.isHighSpeed = ''
    add_data.type = ''
    add_data.price = ''
    add_data.points = []
    add_data.persons = []





    add_data.returnOrder.fromLocation = ''
    add_data.returnOrder.toLocation = ''
    add_data.returnOrder.personNum = ''
    add_data.returnOrder.cusName = ''
    add_data.returnOrder.cusMobile = ''
    add_data.returnOrder.remark = ''
    add_data.returnOrder.flightDate = ''
    add_data.returnOrder.landDate = ''
    add_data.returnOrder.fromLocationId = ''
    add_data.returnOrder.toLocationId = ''
    add_data.returnOrder.fromLocationData.address = ''
    add_data.returnOrder.fromLocationData.area = ''
    add_data.returnOrder.fromLocationData.id = ''
    add_data.returnOrder.fromLocationData.isSta = ''
    add_data.returnOrder.fromLocationData.lnglat = ''
    add_data.returnOrder.fromLocationData.name = ''
    add_data.returnOrder.fromLocationData.tel = ''
    add_data.returnOrder.fromLocationData.type = ''
    add_data.returnOrder.toLocationData.address = ''
    add_data.returnOrder.toLocationData.area = ''
    add_data.returnOrder.toLocationData.id = ''
    add_data.returnOrder.toLocationData.isSta = ''
    add_data.returnOrder.toLocationData.lnglat = ''
    add_data.returnOrder.toLocationData.name = ''
    add_data.returnOrder.toLocationData.tel = ''
    add_data.returnOrder.toLocationData.type = ''

    add_data.returnOrder.routeSimpleName = ''
    add_data.returnOrder.needSeats = ''
    add_data.returnOrder.flightTime = ''
    add_data.returnOrder.days = ''
    add_data.returnOrder.isHighSpeed = ''
    add_data.returnOrder.type = ''
    add_data.returnOrder.price = ''
    add_data.returnOrder.points = []
    add_data.returnOrder.persons = []

    add_cusName_list.value = []
    add_cusName_index.value = 0
    add_cusName_off.value = ''
    add_cusName_list2.value = []
    add_cusName_index2.value = 0

    passing_points_list.value = []
    passing_points_index.value = 0
    passing_points_off.value = ''
    passing_points_list2.value = []
    passing_points_index2.value = 0


    add_off.value = true


}


//#endregion

watch(() => add_data.fromLocation, () => {

    if (activeName_tabs2.value == 'aircraft_connect' && add_data.fromLocation.includes('天府')) {
        chartered_bus_off.value = true
        console.log(chartered_bus_off2.value)
    }
})
watch(() => add_data.toLocation, () => {
    if (activeName_tabs2.value == 'aircraft_deliver' && add_data.toLocation.includes('天府')) {
        chartered_bus_off.value = true
    }
})
watch(() => add_data.returnOrder.fromLocation, () => {
    if (activeName_tabs2.value == 'aircraft_connect' && add_data.returnOrder.fromLocation.includes('天府')) {
        chartered_bus_off2.value = true
    }
})
watch(() => add_data.returnOrder.toLocation, () => {
    if (activeName_tabs2.value == 'aircraft_deliver' && add_data.returnOrder.toLocation.includes('天府')) {
        chartered_bus_off2.value = true
    }
})
//#region 表格选择
const table_list = ref([])
const selection_change_btn = (e) => {
    table_list.value = e
    console.log(e)
}
//#endregion
//#region 修改
const up_btn = () => {
    if (table_list.value.length != 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    }
    title.value = '修改订单'
    getOrderInfo({ id: table_list.value[0].id }).then(res => {
        let data_obj = res.data
        add_data.returnTime = data_obj.returnOrder ? data_obj.returnOrder.startTime : ''
        add_data.startTime = data_obj.order ? data_obj.order.startTime : ''
        add_data.cusMobile = data_obj.cusMobile
        add_data.cusName = data_obj.cusName
        add_data.flightDate = data_obj.flightDate
        add_data.flightNum = data_obj.flightNum
        add_data.fromLocation = data_obj.fromLocation
        add_data.fromLocationData.address = data_obj.fromLocationData.address
        add_data.fromLocationData.area = data_obj.fromLocationData.area
        add_data.fromLocationData.id = data_obj.fromLocationData.id
        add_data.fromLocationData.isSta = data_obj.fromLocationData.isSta
        add_data.fromLocationData.lnglat = data_obj.fromLocationData.lnglat
        add_data.fromLocationData.name = data_obj.fromLocationData.name
        add_data.fromLocationData.tel = data_obj.fromLocationData.tel
        add_data.fromLocationData.type = data_obj.fromLocationData.type
        add_data.fromLocationId = data_obj.fromLocationId
        add_data.isReturnAdd = data_obj.isReturnAdd == true ? '是' : '否'
        add_data.landDate = data_obj.landDate
        add_data.personNum = data_obj.personNum
        add_data.receiveMsg = data_obj.receiveMsg
        add_data.remark = data_obj.remark
        if (data_obj.routeSimpleName == '接天府' || data_obj.routeSimpleName == '送天府') {
            add_data.routeSimpleName = data_obj.routeSimpleName == '接天府' ? '拼车接天府' : '拼车送天府'
        } else {
            add_data.routeSimpleName = data_obj.routeSimpleName
        }

        add_data.toLocation = data_obj.toLocation
        add_data.toLocationData.address = data_obj.toLocationData.address
        add_data.toLocationData.area = data_obj.toLocationData.area
        add_data.toLocationData.id = data_obj.toLocationData.id
        add_data.toLocationData.isSta = data_obj.toLocationData.isSta
        add_data.toLocationData.lnglat = data_obj.toLocationData.lnglat
        add_data.toLocationData.name = data_obj.toLocationData.name
        add_data.toLocationData.tel = data_obj.toLocationData.tel
        add_data.toLocationData.type = data_obj.toLocationData.type
        add_data.toLocationId = data_obj.toLocationId
        add_data.userId = data_obj.userId
        add_data.id = data_obj.id

        add_data.needSeats = data_obj.needSeats
        add_data.flightTime = data_obj.flightTime
        add_data.days = data_obj.days
        add_data.isHighSpeed = data_obj.isHighSpeed
        add_data.type = data_obj.type
        add_data.price = data_obj.price
        add_data.points = data_obj.points
        add_data.persons = data_obj.persons
        passing_points_list.value = data_obj.points
        passing_points_index.value = data_obj.points.length
        add_cusName_list.value = data_obj.persons
        add_cusName_index.value = data_obj.persons.length


        add_data.returnOrder.fromLocation = ''
        add_data.returnOrder.toLocation = ''
        add_data.returnOrder.personNum = ''
        add_data.returnOrder.cusName = ''
        add_data.returnOrder.cusMobile = ''
        add_data.returnOrder.remark = ''
        add_data.returnOrder.flightDate = ''
        add_data.returnOrder.landDate = ''
        add_data.returnOrder.fromLocationId = ''
        add_data.returnOrder.toLocationId = ''
        add_data.returnOrder.fromLocationData.address = ''
        add_data.returnOrder.fromLocationData.area = ''
        add_data.returnOrder.fromLocationData.id = ''
        add_data.returnOrder.fromLocationData.isSta = ''
        add_data.returnOrder.fromLocationData.lnglat = ''
        add_data.returnOrder.fromLocationData.name = ''
        add_data.returnOrder.fromLocationData.tel = ''
        add_data.returnOrder.fromLocationData.type = ''
        add_data.returnOrder.toLocationData.address = ''
        add_data.returnOrder.toLocationData.area = ''
        add_data.returnOrder.toLocationData.id = ''
        add_data.returnOrder.toLocationData.isSta = ''
        add_data.returnOrder.toLocationData.lnglat = ''
        add_data.returnOrder.toLocationData.name = ''
        add_data.returnOrder.toLocationData.tel = ''
        add_data.returnOrder.toLocationData.type = ''
        if (data_obj.returnOrder) {
            add_data.returnOrder.fromLocation = data_obj.returnOrder.fromLocation
            add_data.returnOrder.toLocation = data_obj.returnOrder.toLocation
            add_data.returnOrder.personNum = data_obj.returnOrder.personNum
            add_data.returnOrder.cusName = data_obj.returnOrder.cusName
            add_data.returnOrder.cusMobile = data_obj.returnOrder.cusMobile
            add_data.returnOrder.remark = data_obj.returnOrder.remark
            add_data.returnOrder.flightDate = data_obj.returnOrder.flightDate
            add_data.returnOrder.landDate = data_obj.returnOrder.landDate
            add_data.returnOrder.fromLocationId = data_obj.returnOrder.fromLocationId
            add_data.returnOrder.toLocationId = data_obj.returnOrder.toLocationId
            add_data.returnOrder.fromLocationData.address = data_obj.returnOrder.fromLocationData.address
            add_data.returnOrder.fromLocationData.area = data_obj.returnOrder.fromLocationData.area
            add_data.returnOrder.fromLocationData.id = data_obj.returnOrder.fromLocationData.id
            add_data.returnOrder.fromLocationData.isSta = data_obj.returnOrder.fromLocationData.isSta
            add_data.returnOrder.fromLocationData.lnglat = data_obj.returnOrder.fromLocationData.lnglat
            add_data.returnOrder.fromLocationData.name = data_obj.returnOrder.fromLocationData.name
            add_data.returnOrder.fromLocationData.tel = data_obj.returnOrder.fromLocationData.tel
            add_data.returnOrder.fromLocationData.type = data_obj.returnOrder.fromLocationData.type
            add_data.returnOrder.toLocationData.address = data_obj.returnOrder.toLocationData.address
            add_data.returnOrder.toLocationData.area = data_obj.returnOrder.toLocationData.area
            add_data.returnOrder.toLocationData.id = data_obj.returnOrder.toLocationData.id
            add_data.returnOrder.toLocationData.isSta = data_obj.returnOrder.toLocationData.isSta
            add_data.returnOrder.toLocationData.lnglat = data_obj.returnOrder.toLocationData.lnglat
            add_data.returnOrder.toLocationData.name = data_obj.returnOrder.toLocationData.name
            add_data.returnOrder.toLocationData.tel = data_obj.returnOrder.toLocationData.tel
            add_data.returnOrder.toLocationData.type = data_obj.returnOrder.toLocationData.type

            add_data.returnOrder.needSeats = data_obj.returnOrder.needSeats
            add_data.returnOrder.flightTime = data_obj.returnOrder.flightTime
            add_data.returnOrder.days = data_obj.returnOrder.days
            add_data.returnOrder.isHighSpeed = data_obj.returnOrder.isHighSpeed
            add_data.returnOrder.type = data_obj.returnOrder.type
            add_data.returnOrder.price = data_obj.returnOrder.price
            add_data.returnOrder.points = data_obj.returnOrder.points
            add_data.returnOrder.persons = data_obj.returnOrder.persons

            passing_points_list2.value = data_obj.returnOrder.points
            passing_points_index2.value = data_obj.returnOrder.points.length
            add_cusName_list2.value = data_obj.returnOrder.persons
            add_cusName_index2.value = data_obj.returnOrder.persons.length

        }

    })



    add_off.value = true
}
//#endregion

//#region 时间增加30分钟
const add30Minutes = (dateTimeStr) => {
    let date = new Date(dateTimeStr);
    date.setMinutes(date.getMinutes() + 30);

    let year = date.getFullYear();
    let month = (date.getMonth() + 1).toString().padStart(2, '0');
    let day = date.getDate().toString().padStart(2, '0');
    let hours = date.getHours().toString().padStart(2, '0');
    let minutes = date.getMinutes().toString().padStart(2, '0');

    let newDateTimeStr = `${year}-${month}-${day} ${hours}:${minutes}`;
    return newDateTimeStr;
}

//#endregion

//#region 时间提前4个小时
// 定义表示时间的字符串
const add4hours = (dateString) => {
    console.log(dateString);
    // 将时间字符串转换为日期对象
    let dateObj = new Date(dateString);

    // 将时间提前4个小时
    dateObj.setHours(dateObj.getHours() - 4);

    // 格式化新的日期时间
    let year = dateObj.getFullYear();
    let month = ("0" + (dateObj.getMonth() + 1)).slice(-2);
    let day = ("0" + dateObj.getDate()).slice(-2);
    let hours = ("0" + dateObj.getHours()).slice(-2);
    let minutes = ("0" + dateObj.getMinutes()).slice(-2);

    let newDateString = year + "-" + month + "-" + day + " " + hours + ":" + minutes;

    console.log(newDateString);
    // 输出新的日期时间字符串
    return newDateString;


}
//#endregion

// 提交
const ok_btn = () => {

    let timeDate = new Date().getTime()
    if (add_data.flightDate) {
        let flightDate1 = new Date(add_data.flightDate).getTime()
        // if (flightDate1 < timeDate) {
        //     return ElMessage({
        //         message: '时间不能小于当前时间',
        //         type: 'warning',
        //     })
        // }
    }
    if (add_data.returnOrder.flightDate) {
        let flightDate2 = new Date(add_data.returnOrder.flightDate).getTime()
        // if (flightDate2 < timeDate) {
        //     return ElMessage({
        //         message: '时间不能小于当前时间',
        //         type: 'warning',
        //     })
        // }
    }
    if (add_data.landDate) {
        let landDate1 = new Date(add_data.landDate).getTime()
        // if (landDate1 < timeDate) {
        //     return ElMessage({
        //         message: '时间不能小于当前时间',
        //         type: 'warning',
        //     })
        // }
    }
    if (add_data.returnOrder.landDate) {
        let landDate2 = new Date(add_data.returnOrder.landDate).getTime()
        // if (landDate2 < timeDate) {
        //     return ElMessage({
        //         message: '时间不能小于当前时间',
        //         type: 'warning',
        //     })
        // }
    }






    if (!add_data.landDate) {
        return ElMessage({
            message: '请选择时间',
            type: 'warning',
        })
    } else if (!add_data.fromLocation) {
        return ElMessage({
            message: '请选择开始地址',
            type: 'warning',
        })
    }
    else if (!add_data.toLocation) {
        return ElMessage({
            message: '请选择目的地址',
            type: 'warning',
        })
    }

    if (!add_data.personNum) {
        return ElMessage({
            message: '请输入预约人数',
            type: 'warning',
        })
    } else if (!add_data.cusName) {
        return ElMessage({
            message: '请输入乘车人姓名',
            type: 'warning',
        })
    } else if (!add_data.cusMobile) {
        return ElMessage({
            message: '请输入乘车人电话',
            type: 'warning',
        })
    } else if (!add_data.isReturnAdd) {
        return ElMessage({
            message: '请输入是否返程',
            type: 'warning',
        })
    }

    if (title.value == '添加订单') {




        if (activeName_tabs2.value == 'aircraft_connect') {
            if (add_data.fromLocation.includes('天府')) {

                if (aircraft_radio.value == '拼车') {
                    add_data.routeSimpleName = '拼车接天府'
                } else {
                    add_data.routeSimpleName = '接天府'
                }
                if (aircraft_radio2.value == '拼车') {
                    add_data.returnOrder.routeSimpleName = '拼车接天府'
                } else {
                    add_data.returnOrder.routeSimpleName = '接天府'
                }
            } else if (add_data.fromLocation.includes('双流')) {
                add_data.routeSimpleName = '接双流'
                add_data.returnOrder.routeSimpleName = '接双流'
            } else if (add_data.fromLocation.includes('成都北站')) {
                add_data.routeSimpleName = '接北站'
                add_data.returnOrder.routeSimpleName = '接北站'
            } else if (add_data.fromLocation.includes('成都西站')) {
                add_data.routeSimpleName = '接西站'
                add_data.returnOrder.routeSimpleName = '接西站'
            } else if (add_data.fromLocation.includes('成都南站')) {
                add_data.routeSimpleName = '接南站'
                add_data.returnOrder.routeSimpleName = '接南站'
            } else if (add_data.fromLocation.includes('成都东站')) {
                add_data.routeSimpleName = '接东站'
                add_data.returnOrder.routeSimpleName = '送东站'
            } else {
                add_data.routeSimpleName = '接集合点'
                add_data.returnOrder.routeSimpleName = '接集合点'
            }
        } else if (activeName_tabs2.value == 'aircraft_deliver') {
            if (add_data.fromLocation.includes('天府')) {

                if (aircraft_radio.value == '拼车') {
                    add_data.routeSimpleName = '拼车送天府'
                } else {
                    add_data.routeSimpleName = '送天府'
                }
                if (aircraft_radio2.value == '拼车') {
                    add_data.returnOrder.routeSimpleName = '拼车送天府'
                } else {
                    add_data.returnOrder.routeSimpleName = '送天府'
                }
            } else if (add_data.fromLocation.includes('双流')) {
                add_data.routeSimpleName = '送双流'
                add_data.returnOrder.routeSimpleName = '送双流'
            } else if (add_data.fromLocation.includes('成都北站')) {
                add_data.routeSimpleName = '送北站'
                add_data.returnOrder.routeSimpleName = '送北站'
            } else if (add_data.fromLocation.includes('成都西站')) {
                add_data.routeSimpleName = '送西站'
                add_data.returnOrder.routeSimpleName = '送西站'
            } else if (add_data.fromLocation.includes('成都南站')) {
                add_data.routeSimpleName = '送南站'
                add_data.returnOrder.routeSimpleName = '送南站'
            } else if (add_data.fromLocation.includes('成都东站')) {
                add_data.routeSimpleName = '送东站'
                add_data.returnOrder.routeSimpleName = '送东站'
            } else {
                add_data.routeSimpleName = '接集合点'
                add_data.returnOrder.routeSimpleName = '接集合点'
            }
        }

        if (add_data.routeSimpleName != '接集合点') {
            for (let i = 0; i < aircraft_list.value.length; i++) {
                if (add_data.fromLocation == aircraft_list.value[i].station_name) {
                    add_data.fromLocationId = aircraft_list.value[i].id
                    add_data.fromLocationData.address = aircraft_list.value[i].station_name
                    add_data.fromLocationData.area = aircraft_list.value[i].station_name
                    add_data.fromLocationData.lnglat = aircraft_list.value[i].lng_lat
                }
                if (add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是') {

                    add_data.returnOrder.toLocationId = aircraft_list.value[i].id
                    add_data.returnOrder.toLocationData.address = aircraft_list.value[i].station_name
                    add_data.returnOrder.toLocationData.area = aircraft_list.value[i].station_name
                    add_data.returnOrder.toLocationData.lnglat = aircraft_list.value[i].lng_lat
                }
            }
            for (let i = 0; i < train_list.value.length; i++) {
                if (add_data.fromLocation == train_list.value[i].station_name) {
                    add_data.fromLocationId = train_list.value[i].id
                    add_data.fromLocationData.address = train_list.value[i].station_name
                    add_data.fromLocationData.area = train_list.value[i].station_name
                    add_data.fromLocationData.lnglat = train_list.value[i].lng_lat
                }
                if (add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是') {

                    add_data.returnOrder.toLocationId = train_list.value[i].id
                    add_data.returnOrder.toLocationData.address = train_list.value[i].station_name
                    add_data.returnOrder.toLocationData.area = train_list.value[i].station_name
                    add_data.returnOrder.toLocationData.lnglat = train_list.value[i].lng_lat
                }
            }
        }



        if (aircraft_radio.value == '包车') {
            add_data.type = '2'
        } else {
            add_data.type = '0'
        }
        if (aircraft_radio2.value == '包车') {
            add_data.returnOrder.type = '2'
        } else {
            add_data.returnOrder.type = '0'
        }
        if (add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是') {
            add_data.returnOrder.points = passing_points_list2.value
            add_data.returnOrder.persons = add_cusName_list2.value
            add_data.points = passing_points_list.value
            add_data.persons = add_cusName_list.value
            add_data.returnTime = add_data.returnOrder.flightDate
        } else {
            add_data.points = passing_points_list.value
            add_data.persons = add_cusName_list.value
        }

        let luser = JSON.parse(localStorage.getItem("luser"))
        add_data.userId = luser.uname

        add(add_data).then(res => {
            if (res.code == 1) {
                list_api()
                add_off.value = false
                return ElMessage({
                    message: res.msg,
                    type: 'success',
                })
            } else {
                list_api()
                add_off.value = false
                return ElMessage({
                    message: res.msg,
                    type: 'warning',
                })
            }
        })
    } else {
        if (add_data.isReturnAdd == '是') {
            add_data.isReturnAdd = true
        } else {
            add_data.isReturnAdd = false
        }

        if (activeName_tabs2.value == 'aircraft_connect') {
            if (add_data.fromLocation.includes('天府')) {

                if (aircraft_radio.value == '拼车') {
                    add_data.routeSimpleName = '拼车接天府'
                } else {
                    add_data.routeSimpleName = '接天府'
                }
                if (aircraft_radio2.value == '拼车') {
                    add_data.returnOrder.routeSimpleName = '拼车接天府'
                } else {
                    add_data.returnOrder.routeSimpleName = '接天府'
                }
            } else if (add_data.fromLocation.includes('双流')) {
                add_data.routeSimpleName = '接双流'
                add_data.returnOrder.routeSimpleName = '接双流'
            } else if (add_data.fromLocation.includes('成都北站')) {
                add_data.routeSimpleName = '接北站'
                add_data.returnOrder.routeSimpleName = '接北站'
            } else if (add_data.fromLocation.includes('成都西站')) {
                add_data.routeSimpleName = '接西站'
                add_data.returnOrder.routeSimpleName = '接西站'
            } else if (add_data.fromLocation.includes('成都南站')) {
                add_data.routeSimpleName = '接南站'
                add_data.returnOrder.routeSimpleName = '接南站'
            } else if (add_data.fromLocation.includes('成都东站')) {
                add_data.routeSimpleName = '接东站'
                add_data.returnOrder.routeSimpleName = '送东站'
            } else {
                add_data.routeSimpleName = '接集合点'
                add_data.returnOrder.routeSimpleName = '接集合点'
            }
        } else if (activeName_tabs2.value == 'aircraft_deliver') {
            if (add_data.fromLocation.includes('天府')) {

                if (aircraft_radio.value == '拼车') {
                    add_data.routeSimpleName = '拼车送天府'
                } else {
                    add_data.routeSimpleName = '送天府'
                }
                if (aircraft_radio2.value == '拼车') {
                    add_data.returnOrder.routeSimpleName = '拼车送天府'
                } else {
                    add_data.returnOrder.routeSimpleName = '送天府'
                }
            } else if (add_data.fromLocation.includes('双流')) {
                add_data.routeSimpleName = '送双流'
                add_data.returnOrder.routeSimpleName = '送双流'
            } else if (add_data.fromLocation.includes('成都北站')) {
                add_data.routeSimpleName = '送北站'
                add_data.returnOrder.routeSimpleName = '送北站'
            } else if (add_data.fromLocation.includes('成都西站')) {
                add_data.routeSimpleName = '送西站'
                add_data.returnOrder.routeSimpleName = '送西站'
            } else if (add_data.fromLocation.includes('成都南站')) {
                add_data.routeSimpleName = '送南站'
                add_data.returnOrder.routeSimpleName = '送南站'
            } else if (add_data.fromLocation.includes('成都东站')) {
                add_data.routeSimpleName = '送东站'
                add_data.returnOrder.routeSimpleName = '送东站'
            } else {
                add_data.routeSimpleName = '接集合点'
                add_data.returnOrder.routeSimpleName = '接集合点'
            }
        }

        if (add_data.routeSimpleName != '接集合点') {
            for (let i = 0; i < aircraft_list.value.length; i++) {
                if (add_data.fromLocation == aircraft_list.value[i].station_name) {
                    add_data.fromLocationId = aircraft_list.value[i].id
                    add_data.fromLocationData.address = aircraft_list.value[i].station_name
                    add_data.fromLocationData.area = aircraft_list.value[i].station_name
                    add_data.fromLocationData.lnglat = aircraft_list.value[i].lng_lat
                }
                if (add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是') {

                    add_data.returnOrder.toLocationId = aircraft_list.value[i].id
                    add_data.returnOrder.toLocationData.address = aircraft_list.value[i].station_name
                    add_data.returnOrder.toLocationData.area = aircraft_list.value[i].station_name
                    add_data.returnOrder.toLocationData.lnglat = aircraft_list.value[i].lng_lat
                }
            }
            for (let i = 0; i < train_list.value.length; i++) {
                if (add_data.fromLocation == train_list.value[i].station_name) {
                    add_data.fromLocationId = train_list.value[i].id
                    add_data.fromLocationData.address = train_list.value[i].station_name
                    add_data.fromLocationData.area = train_list.value[i].station_name
                    add_data.fromLocationData.lnglat = train_list.value[i].lng_lat
                }
                if (add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是') {

                    add_data.returnOrder.toLocationId = train_list.value[i].id
                    add_data.returnOrder.toLocationData.address = train_list.value[i].station_name
                    add_data.returnOrder.toLocationData.area = train_list.value[i].station_name
                    add_data.returnOrder.toLocationData.lnglat = train_list.value[i].lng_lat
                }
            }
        }



        if (aircraft_radio.value == '包车') {
            add_data.type = '2'
        } else {
            add_data.type = '0'
        }
        if (aircraft_radio2.value == '包车') {
            add_data.returnOrder.type = '2'
        } else {
            add_data.returnOrder.type = '0'
        }
        if (add_data.isReturnAdd == 'true' || add_data.isReturnAdd == '是') {
            add_data.returnOrder.points = passing_points_list2.value
            add_data.returnOrder.persons = add_cusName_list2.value
            add_data.points = passing_points_list.value
            add_data.persons = add_cusName_list.value
        } else {
            add_data.points = passing_points_list.value
            add_data.persons = add_cusName_list.value
        }

        let luser = JSON.parse(localStorage.getItem("luser"))
        add_data.userId = luser.uname




        edit(add_data).then(res => {
            if (res.code == 1) {
                list_api()
                add_off.value = false
                return ElMessage({
                    message: res.msg,
                    type: 'success',
                })
            } else {
                list_api()
                add_off.value = false
                return ElMessage({
                    message: res.msg,
                    type: 'warning',
                })
            }
        })
    }
}

const isReturnAdd_change = (e) => {
    console.log(e)
    if (e == 'true') {

        add_data.returnOrder.personNum = add_data.personNum
        add_data.returnOrder.cusName = add_data.cusName
        add_data.returnOrder.cusMobile = add_data.cusMobile
        add_data.returnOrder.remark = add_data.remark
        if (activeName_tabs2.value == 'aircraft_connect') {
            add_data.returnOrder.fromLocation = add_data.toLocation
            add_data.returnOrder.fromLocationId = add_data.toLocationId
            add_data.returnOrder.fromLocationData.address = add_data.toLocationData.address
            add_data.returnOrder.fromLocationData.area = add_data.toLocationData.area
            add_data.returnOrder.fromLocationData.id = add_data.toLocationData.id
            add_data.returnOrder.fromLocationData.isSta = add_data.toLocationData.isSta
            add_data.returnOrder.fromLocationData.lnglat = add_data.toLocationData.lnglat
            add_data.returnOrder.fromLocationData.name = add_data.toLocationData.name
            add_data.returnOrder.fromLocationData.tel = add_data.toLocationData.tel
            add_data.returnOrder.fromLocationData.type = add_data.toLocationData.type

        } else {
            add_data.returnOrder.toLocation = add_data.fromLocation
            add_data.returnOrder.toLocationId = add_data.fromLocationId
            add_data.returnOrder.toLocationData.address = add_data.fromLocationData.address
            add_data.returnOrder.toLocationData.area = add_data.fromLocationData.area
            add_data.returnOrder.toLocationData.id = add_data.fromLocationData.id
            add_data.returnOrder.toLocationData.isSta = add_data.fromLocationData.isSta
            add_data.returnOrder.toLocationData.lnglat = add_data.fromLocationData.lnglat
            add_data.returnOrder.toLocationData.name = add_data.fromLocationData.name
            add_data.returnOrder.toLocationData.tel = add_data.fromLocationData.tel
            add_data.returnOrder.toLocationData.type = add_data.fromLocationData.type
        }

    }
}

//#region 删除
const del_btn = () => {
    if (table_list.value.length < 1) {
        return ElMessage({
            message: '请选择数据！',
            type: 'warning',
        })
    }

    ElMessageBox.confirm(
        '是否确认删除客户?',
        {
            confirmButtonText: '确认',
            cancelButtonText: '取消',
            type: 'warning',
            distinguishCancelAndClose: 'true',
        }
    )
        .then(() => {
            let ps = []
            for (let i = 0; i <= table_list.value.length; i++) {
                ps.push(table_list.value[0].id)
            }

            omsorderdelete({
                ids: ps
            }).then(res => {
                if (res.code == 1) {
                    list_api()
                    return ElMessage({
                        message: res.msg,
                        type: 'success',
                    })
                } else {
                    return ElMessage({
                        message: res.msg,
                        type: 'warning',
                    })
                }
            })
        })
        .catch((e) => {
            if (e == 'cancel') {
                ElMessage({
                    type: 'warning',
                    message: '取消删除成功',
                })
            }

        })

}
//#endregion

//#region 搜索
const search_btn = () => {
    localStorage.setItem('original_order_list', CircularJSON.stringify(find_data))
    list_api()
}
//#endregion


//#region 订单导出
const out_btn = () => {
    // if (table_list.value.length != 1) {
    //     return ElMessage({
    //         message: '请选择数据一条数据！',
    //         type: 'warning',
    //     })
    // }
    // let response = await omsorderexport({ id: table_list.value[0].id })
    // let url = window.URL.createObjectURL(new Blob([response.data])); // 创建包含响应数据的 Blob 对象
    // const link = document.createElement('a'); // 创建一个隐藏的链接元素
    // link.href = url;
    // link.setAttribute('download', '原始订单列表.xlsx'); // 设置文件名
    // document.body.appendChild(link); // 将链接元素添加到文档中
    // link.click(); // 模拟点击链接进行下载
    // link.remove(); // 下载完成后移除链接元素


    omsorderexport(find_data).then(res => {

        if (res.code == 1) {
            const data = [
                ['订单号', '行程简称', '订单状态', '人数', '航班号', '出发日期', '可等待时间', '起点', '终点', '乘车人', '推广人', '订单价格', '客户备注', '用车单位', '用车负责人', '合并标识', '添加时间'],
            ];
            for (let i = 0; i < res.data.length; i++) {
                let ps = {
                    orderNum: res.data[i].orderNum,
                    routeSimpleName: res.data[i].routeSimpleName,
                    status: res.data[i].status == 'READY_CAR' ? '未派车' : res.data[i].status == 'CAR_READY_CONFIRME' ? '待确认' : res.data[i].status == 'DRIVER_READY_RECEIVE' ? '待接单' : res.data[i].status == 'READY_ROAD' ? '未出行' : res.data[i].status == 'ON_ROADING' ? '未完团' : res.data[i].status == 'FINISHED' ? '完成' : '',
                    personNum: res.data[i].personNum,
                    flightNum: res.data[i].flightNum,
                    flightDate: res.data[i].flightDate,
                    waitDate: res.data[i].waitDate,
                    fromLocation: res.data[i].fromLocation,
                    toLocation: res.data[i].toLocation,
                    personNum: res.data[i].cusName + '-' + res.data[i].cusMobile,
                    shareName: res.data[i].shareName + '-' + res.data[i].shareMobile,
                    price: res.data[i].price,
                    remark: res.data[i].remark,
                    useCarCompanyId: res.data[i].useCarCompanyId,
                    useCarName: res.data[i].useCarName,
                    isMerge: res.data[i].isMerge == true ? '合并' : '未合并',
                    addTime: res.data[i].addTime,

                }
                data.push(Object.values(ps))
            }
            const ws = XLSX.utils.aoa_to_sheet(data);
            const wb = XLSX.utils.book_new();
            XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
            XLSX.writeFile(wb, '单位管理系统-订单列表.xlsx');
            list_api()
            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }

    })

}
//#endregion
</script>

<style scoped lang='scss'>
.div_map {
    position: relative;
    left: 0;
    top: 0;
}

.map_input {
    width: 100%;
    position: absolute;
    z-index: 1;
    display: flex;
    justify-content: center;

}

.map_input2 {
    width: 100%;
    position: absolute;
    z-index: 1;
    display: flex;
    justify-content: center;
    top: 34px;

}

.div_bg:hover {


    background-color: darkgray;
}
</style>

<style>
.el-table .el-table__cell {
    padding: 0px !important;
}



#tab-aircraft_deliver {
    color: red;
}

#tab-train_deliver {
    color: red;
}

#tab-bus_deliver {
    color: red;
}

.col-items::-webkit-scrollbar {
    width: 5px !important;
}

.col-items>label {
    margin-left: 0px !important;
    margin-top: 5px;
    width: 100%;
}
</style>
